From a76aa4d88cd71449c50ae51e222390286658d845 Mon Sep 17 00:00:00 2001 From: Danilo Pantani Date: Thu, 15 Aug 2024 15:26:16 +0200 Subject: [PATCH] bump cosmos-sdk to v0.50.8 and ignite to v28.5.2 --- .github/.codecov.yml | 23 - .github/CODEOWNERS | 6 +- .github/CONTRIBUTING.md | 44 + .github/ISSUE_TEMPLATE/bug-report.md | 48 +- .github/ISSUE_TEMPLATE/feature-request.md | 48 +- .github/PULL_REQUEST_TEMPLATE.md | 42 +- .github/codecov.yml | 75 + .github/workflows/dependency.yml | 2 +- .github/workflows/janitor.yml | 1 - .github/workflows/linkchecker.yml | 4 +- .github/workflows/lint.yml | 31 - .github/workflows/release.yml | 55 + .github/workflows/sims.yml | 71 +- .github/workflows/simulation.yml | 30 + .github/workflows/test-lint.yml | 40 + .github/workflows/test-semantic.yml | 16 + .github/workflows/test.yml | 136 +- .gitignore | 4 + .golangci.yml | 42 + CODEOWNERS | 4 - Makefile | 169 +- README.md | 4 +- TECHNICAL-SETUP.md | 2 +- .../fundraising/module/v1/module.pulsar.go | 593 + .../fundraising/v1/allowed_bidder.pulsar.go | 727 + .../fundraising/v1/auction.pulsar.go | 3793 ++ api/fundraising/fundraising/v1/bid.pulsar.go | 1149 + .../fundraising/v1/genesis.pulsar.go | 1365 + .../fundraising/v1/params.pulsar.go | 901 + .../fundraising/v1/query.pulsar.go | 9202 +++ .../fundraising/v1/query_grpc.pb.go | 379 + api/fundraising/fundraising/v1/tx.pulsar.go | 1110 + api/fundraising/fundraising/v1/tx_grpc.pb.go | 114 + .../fundraising/v1/vesting_queue.pulsar.go | 915 + app/app.go | 892 +- app/app_config.go | 303 + app/config.go | 19 + app/export.go | 106 +- app/genesis.go | 11 +- app/genesis_account.go | 47 + app/ibc.go | 206 + app/params/weights.go | 9 - app/sim_bench_test.go | 150 + app/sim_test.go | 407 +- app/state.go | 246 - buf.work.yaml | 5 - client/docs/docs.go | 5 - client/docs/static/openapi.yml | 55838 ---------------- cmd/encoding.go | 44 - cmd/fundraisingd/cmd/commands.go | 187 + cmd/fundraisingd/cmd/config.go | 62 + cmd/fundraisingd/cmd/root.go | 147 + cmd/fundraisingd/main.go | 18 +- cmd/genaccounts.go | 195 - cmd/prefixes.go | 21 - cmd/root.go | 497 - config-test.yml | 20 +- config.yml | 60 +- docs/docs.go | 40 + docs/static/openapi.yml | 1 + docs/template/index.tpl | 28 + go.mod | 426 +- go.sum | 1033 +- proto/buf.gen.pulsar.yaml | 3 +- proto/buf.gen.swagger.yaml | 2 +- proto/buf.lock | 34 +- proto/buf.yaml | 50 +- .../fundraising/module/v1/module.proto | 16 + .../fundraising/v1/allowed_bidder.proto | 25 + .../v1/auction.proto} | 160 +- proto/fundraising/fundraising/v1/bid.proto | 78 + .../fundraising/fundraising/v1/genesis.proto | 37 + .../{ => fundraising/v1}/params.proto | 26 +- proto/fundraising/fundraising/v1/query.proto | 164 + .../fundraising/{ => fundraising/v1}/tx.proto | 154 +- .../fundraising/v1/vesting_queue.proto | 36 + proto/fundraising/genesis.proto | 41 - proto/fundraising/query.proto | 161 - scripts/protocgen.sh | 34 - scripts/protocgen2.sh | 30 - testutil/keeper/fundraising.go | 73 + testutil/network/network.go | 80 + testutil/nullify/nullify.go | 57 + testutil/sample/sample.go | 23 + testutil/{ => testutil}/simapp/simapp.go | 118 +- tools/tools.go | 3 - x/fundraising/client/cli/flags.go | 34 - x/fundraising/client/cli/query.go | 380 - x/fundraising/client/cli/tx.go | 436 - x/fundraising/client/cli/utils.go | 95 - x/fundraising/client/cli/utils_test.go | 196 - x/fundraising/client/testutil/cli_test.go | 18 - x/fundraising/client/testutil/helpers.go | 103 - x/fundraising/client/testutil/suite_test.go | 1316 - x/fundraising/handler.go | 49 - x/fundraising/{ => keeper}/abci.go | 23 +- x/fundraising/keeper/allowed_bidder.go | 40 + x/fundraising/keeper/auction.go | 711 +- x/fundraising/keeper/auction_test.go | 370 +- x/fundraising/keeper/bid.go | 201 +- x/fundraising/keeper/bid_test.go | 87 +- x/fundraising/keeper/execution.go | 34 +- x/fundraising/keeper/execution_test.go | 68 +- x/fundraising/keeper/genesis.go | 100 - x/fundraising/keeper/genesis_test.go | 115 - x/fundraising/keeper/grpc_query.go | 347 - x/fundraising/keeper/grpc_query_test.go | 583 - x/fundraising/keeper/hooks.go | 128 +- x/fundraising/keeper/hooks_test.go | 84 +- x/fundraising/keeper/invariants.go | 35 +- x/fundraising/keeper/invariants_test.go | 49 +- x/fundraising/keeper/keeper.go | 141 +- x/fundraising/keeper/keeper_test.go | 116 +- x/fundraising/keeper/match.go | 60 +- x/fundraising/keeper/match_test.go | 875 +- x/fundraising/keeper/msg_server.go | 86 +- x/fundraising/keeper/msg_update_params.go | 29 + .../keeper/msg_update_params_test.go | 66 + x/fundraising/keeper/query.go | 17 + x/fundraising/keeper/query_allowed_bidder.go | 56 + .../keeper/query_allowed_bidder_test.go | 145 + x/fundraising/keeper/query_auction.go | 82 + x/fundraising/keeper/query_auction_test.go | 158 + x/fundraising/keeper/query_bid.go | 51 + x/fundraising/keeper/query_bid_test.go | 139 + x/fundraising/keeper/query_params.go | 30 + x/fundraising/keeper/query_params_test.go | 33 + x/fundraising/keeper/query_vesting_queue.go | 33 + .../keeper/query_vesting_queue_test.go | 94 + x/fundraising/keeper/store.go | 338 - x/fundraising/keeper/store_test.go | 169 +- x/fundraising/keeper/vesting.go | 79 +- x/fundraising/keeper/vesting_test.go | 9 +- x/fundraising/module.go | 205 - x/fundraising/module/autocli.go | 117 + x/fundraising/module/genesis.go | 150 + x/fundraising/module/genesis_test.go | 139 + x/fundraising/module/module.go | 255 + x/fundraising/module/simulation.go | 197 + x/fundraising/simulation/cancel_auction.go | 83 + .../simulation/create_batch_auction.go | 93 + .../simulation/create_fixed_price_auction.go | 87 + x/fundraising/simulation/decoder.go | 40 - x/fundraising/simulation/decoder_test.go | 54 - x/fundraising/simulation/genesis.go | 52 - x/fundraising/simulation/genesis_test.go | 76 - x/fundraising/simulation/helpers.go | 61 + x/fundraising/simulation/modify_bid.go | 121 + x/fundraising/simulation/operations.go | 411 - x/fundraising/simulation/operations_test.go | 264 - x/fundraising/simulation/params.go | 34 - x/fundraising/simulation/params_test.go | 35 - x/fundraising/simulation/place_bid.go | 120 + x/fundraising/types/allowed_bidder.go | 8 +- x/fundraising/types/allowed_bidder.pb.go | 400 + x/fundraising/types/allowed_bidder_test.go | 9 +- x/fundraising/types/auction.go | 41 +- x/fundraising/types/auction.pb.go | 1777 + x/fundraising/types/auction_test.go | 63 +- x/fundraising/types/bid.go | 6 +- x/fundraising/types/bid.pb.go | 635 + x/fundraising/types/bid_test.go | 84 +- x/fundraising/types/codec.go | 21 +- x/fundraising/types/errors.go | 27 +- x/fundraising/types/events.go | 30 - x/fundraising/types/expected_keepers.go | 96 +- x/fundraising/types/fundraising.pb.go | 2813 - x/fundraising/types/genesis.go | 82 +- x/fundraising/types/genesis.pb.go | 368 +- x/fundraising/types/genesis_test.go | 110 +- x/fundraising/types/hooks.go | 115 +- x/fundraising/types/keys.go | 113 +- x/fundraising/types/keys_test.go | 210 - x/fundraising/types/match.go | 15 +- x/fundraising/types/match_test.go | 44 +- x/fundraising/types/msgs.go | 349 +- x/fundraising/types/msgs_test.go | 188 +- x/fundraising/types/params.go | 96 +- x/fundraising/types/params.pb.go | 136 +- x/fundraising/types/params_test.go | 21 +- x/fundraising/types/query.pb.go | 1973 +- x/fundraising/types/query.pb.gw.go | 286 +- x/fundraising/types/tx.pb.go | 850 +- x/fundraising/types/utils.go | 7 +- x/fundraising/types/utils_test.go | 9 +- x/fundraising/types/vesting.go | 9 +- x/fundraising/types/vesting_queue.pb.go | 526 + x/fundraising/types/vesting_test.go | 25 +- 188 files changed, 34380 insertions(+), 71737 deletions(-) delete mode 100644 .github/.codecov.yml create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/codecov.yml delete mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/simulation.yml create mode 100644 .github/workflows/test-lint.yml create mode 100644 .github/workflows/test-semantic.yml create mode 100644 .golangci.yml delete mode 100644 CODEOWNERS create mode 100644 api/fundraising/fundraising/module/v1/module.pulsar.go create mode 100644 api/fundraising/fundraising/v1/allowed_bidder.pulsar.go create mode 100644 api/fundraising/fundraising/v1/auction.pulsar.go create mode 100644 api/fundraising/fundraising/v1/bid.pulsar.go create mode 100644 api/fundraising/fundraising/v1/genesis.pulsar.go create mode 100644 api/fundraising/fundraising/v1/params.pulsar.go create mode 100644 api/fundraising/fundraising/v1/query.pulsar.go create mode 100644 api/fundraising/fundraising/v1/query_grpc.pb.go create mode 100644 api/fundraising/fundraising/v1/tx.pulsar.go create mode 100644 api/fundraising/fundraising/v1/tx_grpc.pb.go create mode 100644 api/fundraising/fundraising/v1/vesting_queue.pulsar.go create mode 100644 app/app_config.go create mode 100644 app/config.go create mode 100644 app/genesis_account.go create mode 100644 app/ibc.go delete mode 100644 app/params/weights.go create mode 100644 app/sim_bench_test.go delete mode 100644 app/state.go delete mode 100644 client/docs/docs.go delete mode 100644 client/docs/static/openapi.yml delete mode 100644 cmd/encoding.go create mode 100644 cmd/fundraisingd/cmd/commands.go create mode 100644 cmd/fundraisingd/cmd/config.go create mode 100644 cmd/fundraisingd/cmd/root.go delete mode 100644 cmd/genaccounts.go delete mode 100644 cmd/prefixes.go delete mode 100644 cmd/root.go create mode 100644 docs/docs.go create mode 100644 docs/static/openapi.yml create mode 100644 docs/template/index.tpl create mode 100644 proto/fundraising/fundraising/module/v1/module.proto create mode 100644 proto/fundraising/fundraising/v1/allowed_bidder.proto rename proto/fundraising/{fundraising.proto => fundraising/v1/auction.proto} (51%) create mode 100644 proto/fundraising/fundraising/v1/bid.proto create mode 100644 proto/fundraising/fundraising/v1/genesis.proto rename proto/fundraising/{ => fundraising/v1}/params.proto (65%) create mode 100644 proto/fundraising/fundraising/v1/query.proto rename proto/fundraising/{ => fundraising/v1}/tx.proto (55%) create mode 100644 proto/fundraising/fundraising/v1/vesting_queue.proto delete mode 100644 proto/fundraising/genesis.proto delete mode 100644 proto/fundraising/query.proto delete mode 100644 scripts/protocgen.sh delete mode 100644 scripts/protocgen2.sh create mode 100644 testutil/keeper/fundraising.go create mode 100644 testutil/network/network.go create mode 100644 testutil/nullify/nullify.go create mode 100644 testutil/sample/sample.go rename testutil/{ => testutil}/simapp/simapp.go (66%) delete mode 100644 x/fundraising/client/cli/flags.go delete mode 100644 x/fundraising/client/cli/query.go delete mode 100644 x/fundraising/client/cli/tx.go delete mode 100644 x/fundraising/client/cli/utils.go delete mode 100644 x/fundraising/client/cli/utils_test.go delete mode 100644 x/fundraising/client/testutil/cli_test.go delete mode 100644 x/fundraising/client/testutil/helpers.go delete mode 100644 x/fundraising/client/testutil/suite_test.go delete mode 100644 x/fundraising/handler.go rename x/fundraising/{ => keeper}/abci.go (52%) create mode 100644 x/fundraising/keeper/allowed_bidder.go delete mode 100644 x/fundraising/keeper/genesis.go delete mode 100644 x/fundraising/keeper/genesis_test.go delete mode 100644 x/fundraising/keeper/grpc_query.go delete mode 100644 x/fundraising/keeper/grpc_query_test.go create mode 100644 x/fundraising/keeper/msg_update_params.go create mode 100644 x/fundraising/keeper/msg_update_params_test.go create mode 100644 x/fundraising/keeper/query.go create mode 100644 x/fundraising/keeper/query_allowed_bidder.go create mode 100644 x/fundraising/keeper/query_allowed_bidder_test.go create mode 100644 x/fundraising/keeper/query_auction.go create mode 100644 x/fundraising/keeper/query_auction_test.go create mode 100644 x/fundraising/keeper/query_bid.go create mode 100644 x/fundraising/keeper/query_bid_test.go create mode 100644 x/fundraising/keeper/query_params.go create mode 100644 x/fundraising/keeper/query_params_test.go create mode 100644 x/fundraising/keeper/query_vesting_queue.go create mode 100644 x/fundraising/keeper/query_vesting_queue_test.go delete mode 100644 x/fundraising/keeper/store.go delete mode 100644 x/fundraising/module.go create mode 100644 x/fundraising/module/autocli.go create mode 100644 x/fundraising/module/genesis.go create mode 100644 x/fundraising/module/genesis_test.go create mode 100644 x/fundraising/module/module.go create mode 100644 x/fundraising/module/simulation.go create mode 100644 x/fundraising/simulation/cancel_auction.go create mode 100644 x/fundraising/simulation/create_batch_auction.go create mode 100644 x/fundraising/simulation/create_fixed_price_auction.go delete mode 100644 x/fundraising/simulation/decoder.go delete mode 100644 x/fundraising/simulation/decoder_test.go delete mode 100644 x/fundraising/simulation/genesis.go delete mode 100644 x/fundraising/simulation/genesis_test.go create mode 100644 x/fundraising/simulation/helpers.go create mode 100644 x/fundraising/simulation/modify_bid.go delete mode 100644 x/fundraising/simulation/operations.go delete mode 100644 x/fundraising/simulation/operations_test.go delete mode 100644 x/fundraising/simulation/params.go delete mode 100644 x/fundraising/simulation/params_test.go create mode 100644 x/fundraising/simulation/place_bid.go create mode 100644 x/fundraising/types/allowed_bidder.pb.go create mode 100644 x/fundraising/types/auction.pb.go create mode 100644 x/fundraising/types/bid.pb.go delete mode 100644 x/fundraising/types/events.go delete mode 100644 x/fundraising/types/fundraising.pb.go delete mode 100644 x/fundraising/types/keys_test.go create mode 100644 x/fundraising/types/vesting_queue.pb.go diff --git a/.github/.codecov.yml b/.github/.codecov.yml deleted file mode 100644 index 6f590683..00000000 --- a/.github/.codecov.yml +++ /dev/null @@ -1,23 +0,0 @@ -# To validate: -# cat codecov.yml | curl --data-binary @- https://codecov.io/validate - -codecov: - notify: - require_ci_to_pass: yes - -coverage: - precision: 2 - round: down - range: "50...80" - - status: - project: - default: - target: auto - threshold: 1% - patch: - default: - enabled: no # disable patch since it is noisy and not correct - if_not_found: success - -comment: false \ No newline at end of file diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d1b0df20..cf65d62a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,7 +1,9 @@ # CODEOWNERS: https://help.github.com/articles/about-codeowners/ # Primary repo maintainers -* @ilgooz @jeronimoalbi @Pantani +* @ilgooz @jeronimoalbi @Pantani @julienrbrt # Docs -*.md @ilgooz +*.md @salmad3 @toschdev @ilgooz +docs/* @salmad3 @toschdev @ilgooz +changelog.md @ilgooz @salmad3 @toschdev @jeronimoalbi @Pantani @julienrbrt diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 00000000..30f9c2f3 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,44 @@ +# Contributing guidelines + +If you're willing to create a new PR on Ignite Modules, make sure that you read and comply with this document. + +Start a new [Discussion](https://github.com/tendermint/fundraising/discussions/new) if you want to propose changes to this document. + +Thank you for your contribution! + +## Providing Feedback + +* Before you open an issue, do a web search, and check for [existing open and closed GitHub Issues](https://github.com/tendermint/fundraising/issues) to see if your question has already been asked and answered. If you find a relevant topic, you can comment on that issue. +* To provide feedback or ask a question, create a [GitHub issue](https://github.com/tendermint/fundraising/issues/new/choose). Be sure to provide the relevant information, case study, or informative links as suggested by the Pull Request template. + +## Opening pull requests + +### Choose a good PR title + +Avoid long names in your PR titles. Make sure your title has fewer than 60 characters. + +Follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) guidelines and keywords to find the best title. + +Use parentheses to identify the package or feature that you worked on. For example: `feat(claim)`, `fix(app)`. + +### Review your own code + +Make sure that you manually tested the changes you're introducing before creating a PR or pushing another commit. + +Monitor your PR to make sure that all CI checks pass and the PR shows **All checks have passed** (the checkmark is green). + +### Avoid rebasing commits in your branch + +Avoid rebasing after you open your PRs to reviews. Instead, add more commits to your PR. It's OK to do force pushes if the PR is still in draft mode and was never opened to reviews before. + +A reviewer likes to see a linear commit history while reviewing. If you tend to force push from an older commit, reviewer might lose track in your recent changes and will have to start reviewing from scratch. + +Don't worry about adding too many commits. The commits are squashed into a single commit while merging. Your PR title is used as the commit message. + +### Ask for help + +If you started a PR but couldn't finish it for whatever reason, don't give up. Instead, just ask for help. Someone else can take over and assume the ownership. + +We appreciate every bit of your work! + +## Coding style diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index 644c27a2..1487360f 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -1,39 +1,21 @@ --- -name: Bug Report -about: Create a report to help us squash bugs! +name: Ignite Fundraising bug report +about: Create a report to help us improve +title: '' +labels: report +assignees: '' --- - +**Describe the bug** +A clear and concise description of what the bug is. -## Summary of Bug +**To Reproduce** +Steps to reproduce the behavior: +1. - - -## Version - - - -## Steps to Reproduce - - - -## Tasks - -- - -## References - -- -____ - -## For Admin Use - -- [ ] Not duplicate issue -- [ ] Appropriate labels applied -- [ ] Appropriate contributors tagged -- [ ] Contributor assigned/self-assigned +**Please provide output of commands while in the repo base directory** +- `git rev-parse --verify HEAD` +- `ignite version` +- `go version` +- `uname -a` diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md index 367c9605..99478795 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -1,43 +1,17 @@ --- -name: Feature Request -about: Create a proposal to request a feature +name: Ignite Fundraising feature request +about: Suggest an idea for this project +title: '' +labels: request +assignees: '' --- - +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -## Summary +**Describe the solution you'd like** +A clear and concise description of what you want to happen. - - -## Problem Definition - - - -## Proposal - - - -## Tasks - -- - -## References - -- -____ - -#### For Admin Use - -- [ ] Not duplicate issue -- [ ] Appropriate labels applied -- [ ] Appropriate contributors tagged -- [ ] Contributor assigned/self-assigned +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 151efcd4..be19d962 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,37 +1,21 @@ - + -## Description +Closes #. _in case of a bug fix, this should point to a bug or any other related issue(s)_ - +### What does this PR do? -closes: #XXXX + -## Tasks +### How to test? -- [ ] + -## References +## Checklist -- +These are the criteria that every PR should meet, please check them off as you +review them: ---- - -Before we can merge this PR, please make sure that all the following items have been -checked off. If any of the checklist items are not applicable, please leave them but -write a little note why. - -- [ ] Appropriate labels applied -- [ ] Targeted PR against correct branch -- [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. -- [ ] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/v0.46.0/docs/building-modules/README.md). -- [ ] Wrote unit and integration -- [ ] Updated relevant documentation (`docs/`) or specification (`x//spec/`) -- [ ] Added relevant `godoc` [comments](https://go.dev/blog/godoc). -- [ ] Re-reviewed `Files changed` in the Github PR explorer -- [ ] Review `Codecov Report` in the comment section below once CI passes +- [ ] Include tests +- [ ] Respect code style and lint +- [ ] Update documentation (*.md) (if needed) diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 00000000..31b0edab --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,75 @@ +coverage: + precision: 2 + round: down + range: 70...100 + status: + patch: off + changes: false + project: + default: + target: auto + threshold: 10% + informational: true + modules: + if_ci_failed: error + target: 70% + flags: + - modules + client: + if_ci_failed: error + target: 70% + flags: + - client + +comment: + layout: "reach, diff, files" + behavior: default + require_changes: false + +codecov: + notify: + wait_for_ci: false + +flags: + modules: + carryforward: true + paths: + - "x/" + - "!x/**/client/**/*" + client: + carryforward: true + paths: + - "x/**/client/**/*" + +ignore: + - "x/**/client/cli/query.go" + - "x/**/client/cli/query_params.go" + - "x/**/client/cli/tx.go" + - "x/**/client/cli/tx_*.go" + - "x/**/keeper/keeper.go" + - "x/**/keeper/msg_server.go" + - "x/**/keeper/grpc_query_params.go" + - "x/**/keeper/invariants.go" + - "x/**/types/codec.go" + - "x/**/types/errors.go" + - "x/**/types/keys.go" + - "x/**/types/key_*.go" + - "x/**/types/types.go" + - "x/**/module.go" + - "x/**/handler.go" + - "x/**/module_simulation.go" + - "*.proto" + - "*.md" + - "*.yml" + - "*.yaml" + - "*.pb.go" + - "*.pb.gw.go" + - ".github/" + - "app/" + - "cmd/" + - "docs/" + - "proto/" + - "scripts/" + - "testutil/" + - "dart/" + - "vue/" diff --git a/.github/workflows/dependency.yml b/.github/workflows/dependency.yml index a6024c5e..55f5fec0 100644 --- a/.github/workflows/dependency.yml +++ b/.github/workflows/dependency.yml @@ -11,6 +11,6 @@ jobs: runs-on: ubuntu-latest steps: - name: 'Checkout Repository' - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 'Dependency Review' uses: actions/dependency-review-action@v3 \ No newline at end of file diff --git a/.github/workflows/janitor.yml b/.github/workflows/janitor.yml index f1a6ddd6..ecc2e487 100644 --- a/.github/workflows/janitor.yml +++ b/.github/workflows/janitor.yml @@ -13,5 +13,4 @@ jobs: steps: - uses: styfle/cancel-workflow-action@0.11.0 with: - workflow_id: 24088051,15584120 access_token: ${{ github.token }} diff --git a/.github/workflows/linkchecker.yml b/.github/workflows/linkchecker.yml index 1ae51542..241c4c16 100644 --- a/.github/workflows/linkchecker.yml +++ b/.github/workflows/linkchecker.yml @@ -6,14 +6,14 @@ on: branches: - main - develop - schedule: + schedule: - cron: '* */24 * * *' jobs: markdown-link-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: gaurav-nelson/github-action-markdown-link-check@1.0.15 with: folder-path: "." diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index f7a5daf0..00000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Lint -# Lint runs golangci-lint over the entire cosmos-sdk repository -# This workflow is run on every pull request and push to main -# The `golangci` will pass without running if no *.{go, mod, sum} files have been changed. -on: - pull_request: - push: - branches: - - main -jobs: - golangci: - name: golangci-lint - runs-on: ubuntu-latest - steps: - - uses: actions/setup-go@v4 - with: - go-version: 1.19 - - uses: technote-space/get-diff-action@v6 - id: git_diff - with: - PATTERNS: | - **/**.go - go.mod - go.sum - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - version: latest - args: --out-format=tab - skip-go-installation: true - if: env.GIT_DIFF \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..2ceabd4d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,55 @@ +# This workflow is useful if you want to automate the process of: +# +# a) Creating a new prelease when you push a new tag with a "v" prefix (version). +# +# This type of prerelease is meant to be used for production: alpha, beta, rc, etc. types of releases. +# After the prerelease is created, you need to make your changes on the release page at the relevant +# Github page and publish your release. +# +# b) Creating/updating the "latest" prerelease when you push to your default branch. +# +# This type of prelease is useful to make your bleeding-edge binaries available to advanced users. +# +# The workflow will not run if there is no tag pushed with a "v" prefix and no change pushed to your +# default branch. +on: push + +jobs: + might_release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Prepare Release Variables + id: vars + uses: ignite/cli/actions/release/vars@main + + - name: Issue Release Assets + uses: ignite/cli/actions/cli@main + if: ${{ steps.vars.outputs.should_release == 'true' }} + with: + args: chain build --release --release.prefix ${{ steps.vars.outputs.tarball_prefix }} -t linux:amd64 -t darwin:amd64 -t darwin:arm64 -y + env: + DO_NOT_TRACK: 1 + + - name: Delete the "latest" Release + uses: dev-drprasad/delete-tag-and-release@v0.2.1 + if: ${{ steps.vars.outputs.is_release_type_latest == 'true' }} + with: + tag_name: ${{ steps.vars.outputs.tag_name }} + delete_release: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish the Release + uses: softprops/action-gh-release@v1 + if: ${{ steps.vars.outputs.should_release == 'true' }} + with: + tag_name: ${{ steps.vars.outputs.tag_name }} + files: release/* + prerelease: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml index 1d2d9827..145a465f 100644 --- a/.github/workflows/sims.yml +++ b/.github/workflows/sims.yml @@ -6,16 +6,24 @@ on: push: branches: - main + - release/* + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: build: runs-on: ubuntu-latest 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 + if: env.GIT_DIFF with: - go-version: 1.19 + go-version: "stable" + cache: true + cache-dependency-path: go.sum - name: Display go version run: go version - run: make build @@ -24,26 +32,32 @@ jobs: runs-on: ubuntu-latest needs: build steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 + if: env.GIT_DIFF with: - go-version: 1.19 + go-version: "stable" + cache: true + cache-dependency-path: go.sum - name: Display go version run: go version - name: Install runsim run: export GO111MODULE="on" && go install github.com/cosmos/tools/cmd/runsim@v1.0.0 - - uses: actions/cache@v3 + - uses: actions/cache@v2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary test-sim-nondeterminism: runs-on: ubuntu-latest - needs: [build, install-runsim] + needs: [ build, install-runsim ] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + if: env.GIT_DIFF with: - go-version: 1.19 + go-version: "stable" + cache: true + cache-dependency-path: go.sum - name: Display go version run: go version - uses: technote-space/get-diff-action@v6 @@ -52,11 +66,6 @@ jobs: **/**.go go.mod go.sum - - uses: actions/cache@v3 - with: - path: ~/go/bin - key: ${{ runner.os }}-go-runsim-binary - if: env.GIT_DIFF - name: test-sim-nondeterminism run: | make test-sim-nondeterminism @@ -64,12 +73,15 @@ jobs: test-sim-import-export: runs-on: ubuntu-latest - needs: [build, install-runsim] + needs: [ build, install-runsim ] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + if: env.GIT_DIFF with: - go-version: 1.19 + go-version: "stable" + cache: true + cache-dependency-path: go.sum - name: Display go version run: go version - uses: technote-space/get-diff-action@v6 @@ -80,11 +92,6 @@ jobs: go.sum SET_ENV_NAME_INSERTIONS: 1 SET_ENV_NAME_LINES: 1 - - uses: actions/cache@v3 - with: - path: ~/go/bin - key: ${{ runner.os }}-go-runsim-binary - if: env.GIT_DIFF - name: test-sim-import-export run: | make test-sim-import-export @@ -92,12 +99,15 @@ jobs: test-sim-after-import: runs-on: ubuntu-latest - needs: [build, install-runsim] + needs: [ build, install-runsim ] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + if: env.GIT_DIFF with: - go-version: 1.19 + go-version: "stable" + cache: true + cache-dependency-path: go.sum - name: Display go version run: go version - uses: technote-space/get-diff-action@v6 @@ -108,11 +118,6 @@ jobs: go.sum SET_ENV_NAME_INSERTIONS: 1 SET_ENV_NAME_LINES: 1 - - uses: actions/cache@v3 - with: - path: ~/go/bin - key: ${{ runner.os }}-go-runsim-binary - if: env.GIT_DIFF - name: test-sim-after-import run: | make test-sim-after-import diff --git a/.github/workflows/simulation.yml b/.github/workflows/simulation.yml new file mode 100644 index 00000000..e3a06357 --- /dev/null +++ b/.github/workflows/simulation.yml @@ -0,0 +1,30 @@ +name: Simulation Tests + +on: + pull_request: + push: + paths-ignore: + - '*.md' + branches: + - main + - release/* + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + if: env.GIT_DIFF + with: + go-version: "stable" + cache: true + cache-dependency-path: go.sum + + - name: Run simulation tests + run: make test-sim-ci diff --git a/.github/workflows/test-lint.yml b/.github/workflows/test-lint.yml new file mode 100644 index 00000000..5b2d2b9d --- /dev/null +++ b/.github/workflows/test-lint.yml @@ -0,0 +1,40 @@ +name: Lint +on: + pull_request: + push: + branches: + - main + - release/* + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + lint: + name: golangci-lint + runs-on: ubuntu-latest + timeout-minutes: 6 + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + if: env.GIT_DIFF + with: + go-version: "stable" + cache: true + cache-dependency-path: go.sum + + - uses: technote-space/get-diff-action@v6 + with: + PATTERNS: | + **/**.go + go.mod + go.sum + + - uses: golangci/golangci-lint-action@v6 + with: + version: v1.58.0 + args: --issues-exit-code=0 -e SA1019 --timeout 10m + github-token: ${{ secrets.github_token }} + if: env.GIT_DIFF diff --git a/.github/workflows/test-semantic.yml b/.github/workflows/test-semantic.yml new file mode 100644 index 00000000..5d00d201 --- /dev/null +++ b/.github/workflows/test-semantic.yml @@ -0,0 +1,16 @@ +name: PR Semantic + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + semantic_pr: + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b0a27354..f815f778 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,129 +1,55 @@ -name: Tests / Code Coverage -# Tests / Code Coverage workflow runs unit tests and uploads a code coverage report -# This workflow is run on pushes to main & every Pull Requests where a .go, .mod, .sum have been changed +name: Unit Tests + on: pull_request: push: + paths-ignore: + - '*.md' branches: - main -jobs: - cleanup-runs: - runs-on: ubuntu-latest - steps: - - uses: rokroskar/workflow-run-cleanup-action@master - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop'" - - build: - runs-on: ubuntu-latest - strategy: - matrix: - go-arch: [ "amd64", "arm64" ] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 - with: - go-version: 1.19 - - uses: technote-space/get-diff-action@v6 - id: git_diff - with: - PATTERNS: | - **/**.go - go.mod - go.sum - - name: Build - run: GOARCH=${{ matrix.go-arch }} LEDGER_ENABLED=false make build + - release/* +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: test: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + if: env.GIT_DIFF with: - go-version: 1.19 + go-version: "stable" + cache: true + cache-dependency-path: go.sum - name: Run unit tests - run: go test -v -coverprofile=coverage.out -coverpkg=./... -covermode=atomic ./... + run: | + go test -v -coverprofile=coverage.txt -covermode=atomic -coverpkg=./... $(go list ./...) - - name: filter out DONTCOVER + - name: filter non-testable files run: | excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')" excludelist+=" $(find ./ -type f -name '*.pb.go')" excludelist+=" $(find ./ -type f -name '*.pb.gw.go')" - excludelist+=" $(find ./ -type f -path './tests/mocks/*.go')" + excludelist+=" $(find ./app -type d)" + excludelist+=" $(find ./cmd -type d)" + excludelist+=" $(find ./proto -type d)" + excludelist+=" $(find ./testutil -type d)" + excludelist+=" $(find ./tools -type d)" for filename in ${excludelist}; do - filename=$(echo $filename | sed 's/^./github.com\/tendermint\/fundraising/g') + filename=${filename#".//"} echo "Excluding ${filename} from coverage report..." - sed -i "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.out + filename=$(echo "$filename" | sed 's/\//\\\//g') + sed -i.bak "/""$filename""/d" coverage.txt done - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: - fail_ci_if_error: true + file: ./coverage.txt + fail_ci_if_error: false verbose: true - token: ${{secrets.CODECOV_TOKEN}} - - test-coverage: - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 - with: - go-version: 1.19 - - name: display go version - run: go version - - name: test & coverage report creation - run: make test-cover - - name: filter out DONTCOVER - run: | - excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')" - excludelist+=" $(find ./ -type f -name '*.pb.go')" - excludelist+=" $(find ./ -type f -name '*.pb.gw.go')" - excludelist+=" $(find ./ -type f -path './tests/mocks/*.go')" - for filename in ${excludelist}; do - filename=$(echo $filename | sed 's/^./github.com\/tendermint\/fundraising/g') - echo "Excluding ${filename} from coverage report..." - sed -i "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.out - done - - uses: codecov/codecov-action@v3 - with: - file: ./coverage.out - - test-race: - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 - with: - go-version: 1.19 - - name: display go version - run: go version - - name: test & coverage report creation - run: make test-race - - name: filter out DONTCOVER - run: | - excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')" - excludelist+=" $(find ./ -type f -name '*.pb.go')" - excludelist+=" $(find ./ -type f -name '*.pb.gw.go')" - excludelist+=" $(find ./ -type f -path './tests/mocks/*.go')" - for filename in ${excludelist}; do - filename=$(echo $filename | sed 's/^./github.com\/tendermint\/fundraising/g') - echo "Excluding ${filename} from coverage report..." - sed -i "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.out - done - - uses: codecov/codecov-action@v3 - with: - file: ./coverage.out \ No newline at end of file diff --git a/.gitignore b/.gitignore index efbaf685..f3d88e79 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,9 @@ dist tools-stamp proto-tools-stamp buf-stamp +release/ +*.dot +*.ign # Data - ideally these don't exist app/data/* @@ -44,6 +47,7 @@ sim_log_file vagrant # IDE +.vscode/ .idea/ *.iml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..68c03078 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,42 @@ +run: + tests: false + # # timeout for analysis, e.g. 30s, 5m, default is 1m + timeout: 5m + +linters: + disable-all: true + enable: + - bodyclose + - depguard + - dogsled + - errcheck + - goconst + - gocritic + - gofumpt + - revive + - gosec + - gosimple + - govet + - ineffassign + # - interfacer + # - maligned + - misspell + - nakedret + - prealloc + # - scopelint + - staticcheck + - stylecheck + - typecheck + - unconvert + - unused + - unparam + - misspell + # - wsl + - nolintlint + +issues: + exclude: + - G404 + - G101 + max-issues-per-linter: 10000 + max-same-issues: 10000 diff --git a/CODEOWNERS b/CODEOWNERS deleted file mode 100644 index 657410e8..00000000 --- a/CODEOWNERS +++ /dev/null @@ -1,4 +0,0 @@ -# CODEOWNERS: https://help.github.com/articles/about-codeowners/ - -# Primary repo maintainers -* @dongsam @kogisin @hallazzang @typark391 \ No newline at end of file diff --git a/Makefile b/Makefile index 39e572ee..fd0bea3b 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,16 @@ -#!/usr/bin/make -f +#! /usr/bin/make -f -VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//') +PACKAGES=$(shell go list ./...) +VERSION := $(shell echo $(shell git describe --tags 2> /dev/null || echo "dev-$(shell git describe --always)") | sed 's/^v//') COMMIT := $(shell git log -1 --format='%H') PACKAGES_NOSIMULATION=$(shell go list ./... | grep -v '/simulation') +DOCKER := $(shell which docker) +COVER_FILE := coverage.txt +COVER_HTML_FILE := cover.html BINDIR ?= $(GOPATH)/bin DOCKER := $(shell which docker) DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf BUILDDIR ?= $(CURDIR)/build -SIMAPP = ./app export GO111MODULE = on @@ -67,8 +70,44 @@ BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' all: tools install lint -# The below include contains the tools and runsim targets. -include contrib/devtools/Makefile +############################################################################### +### Development ### +############################################################################### + +## govet: Run go vet. +govet: + @echo Running go vet... + @go vet ./... + +## govulncheck: Run govulncheck +govulncheck: + @echo Running govulncheck... + @go run golang.org/x/vuln/cmd/govulncheck ./... + +FIND_ARGS := -name '*.go' -type f -not -name '*.pb.go' -not -name '*.pb.gw.go' + +## format: Run gofumpt and goimports. +format: + @echo Formatting... + @go install mvdan.cc/gofumpt + @go install golang.org/x/tools/cmd/goimports + @find . $(FIND_ARGS) | xargs gofumpt -w . + @find . $(FIND_ARGS) | xargs goimports -w -local github.com/tendermint/fundraising + +## lint: Run Golang CI Lint. +lint: + @echo Running gocilint... + @go install github.com/golangci/golangci-lint/cmd/golangci-lint + @golangci-lint run --out-format=tab --issues-exit-code=0 + +help: Makefile + @echo + @echo " Choose a command run in "$(PROJECT_NAME)", or just run 'make' for install" + @echo + @sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /' + @echo + +.PHONY: lint format govet govulncheck help ############################################################################### ### Build ### @@ -94,7 +133,6 @@ build-reproducible: go.sum --env APP=fundraisingd \ --env VERSION=$(VERSION) \ --env COMMIT=$(COMMIT) \ - --env LEDGER_ENABLED=$(LEDGER_ENABLED) \ --name latest-build cosmossdk/rbuilder:latest $(DOCKER) cp -a latest-build:/home/builder/artifacts/ $(CURDIR)/ @@ -103,7 +141,7 @@ build-reproducible: go.sum ############################################################################### go-mod-cache: go.sum - @echo "--> Download go modules to local cache" + @echo "--> Download go fundraising to local cache" @go mod download go.sum: go.mod @@ -116,41 +154,77 @@ clean: .PHONY: go-mod-cache clean -FIND_ARGS := -name '*.go' -type f -not -name '*.pb.go' +############################################################################### +### Test ### +############################################################################### -## format: Run gofmt and goimports. -format: - @echo Formatting... - @find . $(FIND_ARGS) | xargs gofmt -d -s - @find . $(FIND_ARGS) | xargs goimports -w -local github.com/tendermint/fundraising +## test-unit: Run the unit tests. +test-unit: + @echo Running unit tests... + @VERSION=$(VERSION) go test -mod=readonly -v -timeout 30m $(PACKAGES) -## lint: Run Golang CI Lint. -lint: - @echo Running gocilint... - @golangci-lint run --out-format=tab --issues-exit-code=0 +## test-race: Run the unit tests checking for race conditions +test-race: + @echo Running unit tests with race condition reporting... + @VERSION=$(VERSION) go test -mod=readonly -v -race -timeout 30m $(PACKAGES) +## test-cover: Run the unit tests and create a coverage html report +test-cover: + @echo Running unit tests and creating coverage report... + @VERSION=$(VERSION) go test -mod=readonly -v -timeout 30m -coverprofile=$(COVER_FILE) -covermode=atomic $(PACKAGES) + @go tool cover -html=$(COVER_FILE) -o $(COVER_HTML_FILE) + @rm $(COVER_FILE) + +## bench: Run the unit tests with benchmarking enabled +bench: + @echo Running unit tests with benchmarking... + @VERSION=$(VERSION) go test -mod=readonly -v -timeout 30m -bench=. $(PACKAGES) + +## test: Run unit and integration tests. +test: govet govulncheck test-unit + +.PHONY: test test-unit test-race test-cover bench -.PHONY: lint format ############################################################################### -### Tests & Simulation ### +### Protobuf ### ############################################################################### -test: test-unit -test-all: test-unit test-race test-cover +proto-all: proto-format proto-lint proto-gen-gogo -test-unit: - @VERSION=$(VERSION) go test -mod=readonly -tags='norace' $(PACKAGES_NOSIMULATION) +proto-gen-gogo: + @echo "Generating Protobuf Files" + @buf generate --template $(CURDIR)/proto/buf.gen.gogo.yaml --output $(CURDIR)/gen/go + @cp -r gen/go/github.com/tendermint/fundraising/x ./ + @rm -R gen/go -test-race: - @go test -mod=readonly -timeout 30m -race -coverprofile=coverage.out -covermode=atomic -tags='ledger test_ledger_mock' ./... +proto-gen-swagger: + @echo "Generating Protobuf Swagger" + @buf generate --template $(CURDIR)/proto/buf.gen.swagger.yaml --output $(CURDIR)/gen/swagger -test-cover: - @go test -mod=readonly -timeout 30m -coverpkg=./... -coverprofile=coverage.out -covermode=atomic -coverpkg=./... -tags='norace ledger test_ledger_mock' ./... +proto-gen-ts: + @echo "Generating Protobuf Typescript" + @buf generate --template $(CURDIR)/proto/buf.gen.ts.yaml --output $(CURDIR)/gen/ts + +proto-format: + @echo "Formatting Protobuf Files" + @buf format --write + +proto-lint: + @echo "Linting Protobuf Files" + @buf lint + +.PHONY: proto-all proto-gen-gogo proto-gen-swagger proto-gen-ts proto-format proto-lint -.PHONY: test test-all test-unit test-race test-cover +############################################################################### +### Simulation ### +############################################################################### + +# The below include contains the tools and runsim targets. +include contrib/devtools/Makefile -SIM_NUM_BLOCKS ?= 100 -SIM_BLOCK_SIZE ?= 50 +SIMAPP = ./app +SIM_NUM_BLOCKS ?= 500 +SIM_BLOCK_SIZE ?= 100 SIM_CI_NUM_BLOCKS ?= 200 SIM_CI_BLOCK_SIZE ?= 26 SIM_PERIOD ?= 50 @@ -176,15 +250,18 @@ test-sim-after-import: runsim @echo "Running application simulation-after-import. This may take several minutes..." @$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 2 2 TestAppSimulationAfterImport +# test-sim-nondeterminism-long: Run simulation test checking for app state nondeterminism with a big data test-sim-nondeterminism-long: @echo "Running non-determinism test..." @go test -mod=readonly $(SIMAPP) -run TestAppStateDeterminism -Enabled=true \ -NumBlocks=100 -BlockSize=100 -Commit=true -Period=0 -v -timeout 1h +# test-sim-import-export-long: Test import/export simulation test-sim-import-export-long: runsim @echo "Running application import/export simulation. This may take several minutes..." @$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 5 5 TestAppImportExport +# test-sim-import-export-long: Test import/export simulation with a big data test-sim-after-import-long: runsim @echo "Running application simulation-after-import. This may take several minutes..." @$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 5 5 TestAppSimulationAfterImport @@ -221,41 +298,13 @@ test-sim-ci \ test-sim-profile \ test-sim-benchmark -############################################################################### -### Protobuf ### -############################################################################### - -proto-all: proto-format proto-lint proto-gen-gogo - -proto-gen-gogo: - @echo "Generating Protobuf Files" - @buf generate --template $(CURDIR)/proto/buf.gen.gogo.yaml --output $(CURDIR)/gen/go - @cp -r gen/go/github.com/tendermint/fundraising/x ./ - @rm -R gen/go - -proto-gen-swagger: - @echo "Generating Protobuf Swagger" - @buf generate --template $(CURDIR)/proto/buf.gen.swagger.yaml --output $(CURDIR)/gen/swagger - -proto-gen-ts: - @echo "Generating Protobuf Typescript" - @buf generate --template $(CURDIR)/proto/buf.gen.ts.yaml --output $(CURDIR)/gen/ts - -proto-format: - @echo "Formatting Protobuf Files" - @buf format --write - -proto-lint: - @echo "Linting Protobuf Files" - @buf lint - -.PHONY: proto-all proto-gen-gogo proto-gen-swagger proto-gen-ts proto-format proto-lint +.DEFAULT_GOAL := install ############################################################################### ### Localnet ### ############################################################################### -localnet: +localnet: ignite chain serve -r -v -c ./config-test.yml .PHONY: localnet diff --git a/README.md b/README.md index c1545bb7..50f59087 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ If you haven't already, install Golang by following the official Go [install doc Requirement | Notes ----------- | ----------------- -Go | version 1.18 or higher -Cosmos SDK | v0.46.0 +Go | version 1.21 or higher +Cosmos SDK | v0.50.8 ## Installation diff --git a/TECHNICAL-SETUP.md b/TECHNICAL-SETUP.md index 008e294d..43d47cd7 100644 --- a/TECHNICAL-SETUP.md +++ b/TECHNICAL-SETUP.md @@ -16,7 +16,7 @@ Internal Tendermint users have different permissions, if you're not sure, fork t To build the project: -- [Golang](https://golang.org/dl/) v1.16 or higher +- [Golang](https://golang.org/dl/) v1.21 or higher - [make](https://www.gnu.org/software/make/) to use `Makefile` targets ## Development Environment Setup diff --git a/api/fundraising/fundraising/module/v1/module.pulsar.go b/api/fundraising/fundraising/module/v1/module.pulsar.go new file mode 100644 index 00000000..6c31ec57 --- /dev/null +++ b/api/fundraising/fundraising/module/v1/module.pulsar.go @@ -0,0 +1,593 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package modulev1 + +import ( + fmt "fmt" + io "io" + reflect "reflect" + sync "sync" + + _ "cosmossdk.io/api/cosmos/app/v1alpha1" + 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" +) + +var ( + md_Module protoreflect.MessageDescriptor + fd_Module_authority protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_module_v1_module_proto_init() + md_Module = File_fundraising_fundraising_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_fundraising_fundraising_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 + _ 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 "fundraising.fundraising.module.v1.Module.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.module.v1.Module")) + } + panic(fmt.Errorf("message fundraising.fundraising.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 "fundraising.fundraising.module.v1.Module.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.module.v1.Module")) + } + panic(fmt.Errorf("message fundraising.fundraising.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 "fundraising.fundraising.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: fundraising.fundraising.module.v1.Module")) + } + panic(fmt.Errorf("message fundraising.fundraising.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 "fundraising.fundraising.module.v1.Module.authority": + x.Authority = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.module.v1.Module")) + } + panic(fmt.Errorf("message fundraising.fundraising.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 "fundraising.fundraising.module.v1.Module.authority": + panic(fmt.Errorf("field authority of message fundraising.fundraising.module.v1.Module is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.module.v1.Module")) + } + panic(fmt.Errorf("message fundraising.fundraising.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 "fundraising.fundraising.module.v1.Module.authority": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.module.v1.Module")) + } + panic(fmt.Errorf("message fundraising.fundraising.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 fundraising.fundraising.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: fundraising/fundraising/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 for the 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_fundraising_fundraising_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_fundraising_fundraising_module_v1_module_proto_rawDescGZIP(), []int{0} +} + +func (x *Module) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +var File_fundraising_fundraising_module_v1_module_proto protoreflect.FileDescriptor + +var file_fundraising_fundraising_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x21, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 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, 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, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x66, 0x75, 0x6e, + 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x78, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, + 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x42, 0xad, 0x02, 0x0a, 0x25, 0x63, 0x6f, 0x6d, 0x2e, 0x66, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, + 0x61, 0x69, 0x73, 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, + 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, + 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, + 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 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, 0x46, 0x46, 0x4d, 0xaa, 0x02, 0x21, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, + 0x67, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x21, 0x46, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x2d, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x46, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 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, 0x24, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x46, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_fundraising_fundraising_module_v1_module_proto_rawDescOnce sync.Once + file_fundraising_fundraising_module_v1_module_proto_rawDescData = file_fundraising_fundraising_module_v1_module_proto_rawDesc +) + +func file_fundraising_fundraising_module_v1_module_proto_rawDescGZIP() []byte { + file_fundraising_fundraising_module_v1_module_proto_rawDescOnce.Do(func() { + file_fundraising_fundraising_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_fundraising_fundraising_module_v1_module_proto_rawDescData) + }) + return file_fundraising_fundraising_module_v1_module_proto_rawDescData +} + +var ( + file_fundraising_fundraising_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) + file_fundraising_fundraising_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: fundraising.fundraising.module.v1.Module + } +) + +var file_fundraising_fundraising_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_fundraising_fundraising_module_v1_module_proto_init() } +func file_fundraising_fundraising_module_v1_module_proto_init() { + if File_fundraising_fundraising_module_v1_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_fundraising_fundraising_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_fundraising_fundraising_module_v1_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_fundraising_fundraising_module_v1_module_proto_goTypes, + DependencyIndexes: file_fundraising_fundraising_module_v1_module_proto_depIdxs, + MessageInfos: file_fundraising_fundraising_module_v1_module_proto_msgTypes, + }.Build() + File_fundraising_fundraising_module_v1_module_proto = out.File + file_fundraising_fundraising_module_v1_module_proto_rawDesc = nil + file_fundraising_fundraising_module_v1_module_proto_goTypes = nil + file_fundraising_fundraising_module_v1_module_proto_depIdxs = nil +} diff --git a/api/fundraising/fundraising/v1/allowed_bidder.pulsar.go b/api/fundraising/fundraising/v1/allowed_bidder.pulsar.go new file mode 100644 index 00000000..a43e3629 --- /dev/null +++ b/api/fundraising/fundraising/v1/allowed_bidder.pulsar.go @@ -0,0 +1,727 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package fundraisingv1 + +import ( + fmt "fmt" + io "io" + reflect "reflect" + sync "sync" + + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +var ( + md_AllowedBidder protoreflect.MessageDescriptor + fd_AllowedBidder_auction_id protoreflect.FieldDescriptor + fd_AllowedBidder_bidder protoreflect.FieldDescriptor + fd_AllowedBidder_max_bid_amount protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_allowed_bidder_proto_init() + md_AllowedBidder = File_fundraising_fundraising_v1_allowed_bidder_proto.Messages().ByName("AllowedBidder") + fd_AllowedBidder_auction_id = md_AllowedBidder.Fields().ByName("auction_id") + fd_AllowedBidder_bidder = md_AllowedBidder.Fields().ByName("bidder") + fd_AllowedBidder_max_bid_amount = md_AllowedBidder.Fields().ByName("max_bid_amount") +} + +var _ protoreflect.Message = (*fastReflection_AllowedBidder)(nil) + +type fastReflection_AllowedBidder AllowedBidder + +func (x *AllowedBidder) ProtoReflect() protoreflect.Message { + return (*fastReflection_AllowedBidder)(x) +} + +func (x *AllowedBidder) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_allowed_bidder_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_AllowedBidder_messageType fastReflection_AllowedBidder_messageType + _ protoreflect.MessageType = fastReflection_AllowedBidder_messageType{} +) + +type fastReflection_AllowedBidder_messageType struct{} + +func (x fastReflection_AllowedBidder_messageType) Zero() protoreflect.Message { + return (*fastReflection_AllowedBidder)(nil) +} + +func (x fastReflection_AllowedBidder_messageType) New() protoreflect.Message { + return new(fastReflection_AllowedBidder) +} + +func (x fastReflection_AllowedBidder_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_AllowedBidder +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_AllowedBidder) Descriptor() protoreflect.MessageDescriptor { + return md_AllowedBidder +} + +// 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_AllowedBidder) Type() protoreflect.MessageType { + return _fastReflection_AllowedBidder_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_AllowedBidder) New() protoreflect.Message { + return new(fastReflection_AllowedBidder) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_AllowedBidder) Interface() protoreflect.ProtoMessage { + return (*AllowedBidder)(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_AllowedBidder) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AuctionId != uint64(0) { + value := protoreflect.ValueOfUint64(x.AuctionId) + if !f(fd_AllowedBidder_auction_id, value) { + return + } + } + if x.Bidder != "" { + value := protoreflect.ValueOfString(x.Bidder) + if !f(fd_AllowedBidder_bidder, value) { + return + } + } + if x.MaxBidAmount != "" { + value := protoreflect.ValueOfString(x.MaxBidAmount) + if !f(fd_AllowedBidder_max_bid_amount, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_AllowedBidder) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.AllowedBidder.auction_id": + return x.AuctionId != uint64(0) + case "fundraising.fundraising.v1.AllowedBidder.bidder": + return x.Bidder != "" + case "fundraising.fundraising.v1.AllowedBidder.max_bid_amount": + return x.MaxBidAmount != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.AllowedBidder")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.AllowedBidder 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_AllowedBidder) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.AllowedBidder.auction_id": + x.AuctionId = uint64(0) + case "fundraising.fundraising.v1.AllowedBidder.bidder": + x.Bidder = "" + case "fundraising.fundraising.v1.AllowedBidder.max_bid_amount": + x.MaxBidAmount = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.AllowedBidder")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.AllowedBidder 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_AllowedBidder) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.AllowedBidder.auction_id": + value := x.AuctionId + return protoreflect.ValueOfUint64(value) + case "fundraising.fundraising.v1.AllowedBidder.bidder": + value := x.Bidder + return protoreflect.ValueOfString(value) + case "fundraising.fundraising.v1.AllowedBidder.max_bid_amount": + value := x.MaxBidAmount + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.AllowedBidder")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.AllowedBidder 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_AllowedBidder) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.AllowedBidder.auction_id": + x.AuctionId = value.Uint() + case "fundraising.fundraising.v1.AllowedBidder.bidder": + x.Bidder = value.Interface().(string) + case "fundraising.fundraising.v1.AllowedBidder.max_bid_amount": + x.MaxBidAmount = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.AllowedBidder")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.AllowedBidder 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_AllowedBidder) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.AllowedBidder.auction_id": + panic(fmt.Errorf("field auction_id of message fundraising.fundraising.v1.AllowedBidder is not mutable")) + case "fundraising.fundraising.v1.AllowedBidder.bidder": + panic(fmt.Errorf("field bidder of message fundraising.fundraising.v1.AllowedBidder is not mutable")) + case "fundraising.fundraising.v1.AllowedBidder.max_bid_amount": + panic(fmt.Errorf("field max_bid_amount of message fundraising.fundraising.v1.AllowedBidder is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.AllowedBidder")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.AllowedBidder 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_AllowedBidder) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.AllowedBidder.auction_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "fundraising.fundraising.v1.AllowedBidder.bidder": + return protoreflect.ValueOfString("") + case "fundraising.fundraising.v1.AllowedBidder.max_bid_amount": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.AllowedBidder")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.AllowedBidder 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_AllowedBidder) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.AllowedBidder", 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_AllowedBidder) 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_AllowedBidder) 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_AllowedBidder) 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_AllowedBidder) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*AllowedBidder) + 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.AuctionId != 0 { + n += 1 + runtime.Sov(uint64(x.AuctionId)) + } + l = len(x.Bidder) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.MaxBidAmount) + 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().(*AllowedBidder) + 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.MaxBidAmount) > 0 { + i -= len(x.MaxBidAmount) + copy(dAtA[i:], x.MaxBidAmount) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MaxBidAmount))) + i-- + dAtA[i] = 0x1a + } + if len(x.Bidder) > 0 { + i -= len(x.Bidder) + copy(dAtA[i:], x.Bidder) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bidder))) + i-- + dAtA[i] = 0x12 + } + if x.AuctionId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AuctionId)) + 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().(*AllowedBidder) + 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: AllowedBidder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AllowedBidder: 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 AuctionId", wireType) + } + x.AuctionId = 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.AuctionId |= 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 Bidder", 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.Bidder = 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 MaxBidAmount", 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.MaxBidAmount = 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: fundraising/fundraising/v1/allowed_bidder.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) +) + +// AllowedBidder defines an allowed bidder for the auction. +type AllowedBidder struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // auction_id specifies the id of the auction + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + // bidder specifies the bech32-encoded address that bids for the auction + Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` + // max_bid_amount specifies the maximum bid amount that the bidder can bid + MaxBidAmount string `protobuf:"bytes,3,opt,name=max_bid_amount,json=maxBidAmount,proto3" json:"max_bid_amount,omitempty"` +} + +func (x *AllowedBidder) Reset() { + *x = AllowedBidder{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_allowed_bidder_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AllowedBidder) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AllowedBidder) ProtoMessage() {} + +// Deprecated: Use AllowedBidder.ProtoReflect.Descriptor instead. +func (*AllowedBidder) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_allowed_bidder_proto_rawDescGZIP(), []int{0} +} + +func (x *AllowedBidder) GetAuctionId() uint64 { + if x != nil { + return x.AuctionId + } + return 0 +} + +func (x *AllowedBidder) GetBidder() string { + if x != nil { + return x.Bidder + } + return "" +} + +func (x *AllowedBidder) GetMaxBidAmount() string { + if x != nil { + return x.MaxBidAmount + } + return "" +} + +var File_fundraising_fundraising_v1_allowed_bidder_proto protoreflect.FileDescriptor + +var file_fundraising_fundraising_v1_allowed_bidder_proto_rawDesc = []byte{ + 0x0a, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x1a, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 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, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9f, + 0x01, 0x0a, 0x0d, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, + 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, + 0x16, 0x0a, 0x06, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x62, + 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 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, 0x0c, 0x6d, 0x61, + 0x78, 0x42, 0x69, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, + 0x42, 0x8e, 0x02, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, + 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, + 0x2e, 0x76, 0x31, 0x42, 0x12, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x42, 0x69, 0x64, 0x64, + 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, + 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, + 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x75, 0x6e, 0x64, + 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x46, 0x46, 0x58, 0xaa, + 0x02, 0x1a, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1a, 0x46, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x46, 0x75, 0x6e, 0x64, 0x72, + 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, 0x46, 0x75, 0x6e, 0x64, + 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, + 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x1c, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, + 0x3a, 0x3a, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_fundraising_fundraising_v1_allowed_bidder_proto_rawDescOnce sync.Once + file_fundraising_fundraising_v1_allowed_bidder_proto_rawDescData = file_fundraising_fundraising_v1_allowed_bidder_proto_rawDesc +) + +func file_fundraising_fundraising_v1_allowed_bidder_proto_rawDescGZIP() []byte { + file_fundraising_fundraising_v1_allowed_bidder_proto_rawDescOnce.Do(func() { + file_fundraising_fundraising_v1_allowed_bidder_proto_rawDescData = protoimpl.X.CompressGZIP(file_fundraising_fundraising_v1_allowed_bidder_proto_rawDescData) + }) + return file_fundraising_fundraising_v1_allowed_bidder_proto_rawDescData +} + +var ( + file_fundraising_fundraising_v1_allowed_bidder_proto_msgTypes = make([]protoimpl.MessageInfo, 1) + file_fundraising_fundraising_v1_allowed_bidder_proto_goTypes = []interface{}{ + (*AllowedBidder)(nil), // 0: fundraising.fundraising.v1.AllowedBidder + } +) + +var file_fundraising_fundraising_v1_allowed_bidder_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_fundraising_fundraising_v1_allowed_bidder_proto_init() } +func file_fundraising_fundraising_v1_allowed_bidder_proto_init() { + if File_fundraising_fundraising_v1_allowed_bidder_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_fundraising_fundraising_v1_allowed_bidder_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AllowedBidder); 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_fundraising_fundraising_v1_allowed_bidder_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_fundraising_fundraising_v1_allowed_bidder_proto_goTypes, + DependencyIndexes: file_fundraising_fundraising_v1_allowed_bidder_proto_depIdxs, + MessageInfos: file_fundraising_fundraising_v1_allowed_bidder_proto_msgTypes, + }.Build() + File_fundraising_fundraising_v1_allowed_bidder_proto = out.File + file_fundraising_fundraising_v1_allowed_bidder_proto_rawDesc = nil + file_fundraising_fundraising_v1_allowed_bidder_proto_goTypes = nil + file_fundraising_fundraising_v1_allowed_bidder_proto_depIdxs = nil +} diff --git a/api/fundraising/fundraising/v1/auction.pulsar.go b/api/fundraising/fundraising/v1/auction.pulsar.go new file mode 100644 index 00000000..1b187a5d --- /dev/null +++ b/api/fundraising/fundraising/v1/auction.pulsar.go @@ -0,0 +1,3793 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package fundraisingv1 + +import ( + fmt "fmt" + io "io" + reflect "reflect" + sync "sync" + + _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" +) + +var _ protoreflect.List = (*_BaseAuction_10_list)(nil) + +type _BaseAuction_10_list struct { + list *[]*VestingSchedule +} + +func (x *_BaseAuction_10_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_BaseAuction_10_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_BaseAuction_10_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VestingSchedule) + (*x.list)[i] = concreteValue +} + +func (x *_BaseAuction_10_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VestingSchedule) + *x.list = append(*x.list, concreteValue) +} + +func (x *_BaseAuction_10_list) AppendMutable() protoreflect.Value { + v := new(VestingSchedule) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_BaseAuction_10_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_BaseAuction_10_list) NewElement() protoreflect.Value { + v := new(VestingSchedule) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_BaseAuction_10_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_BaseAuction_12_list)(nil) + +type _BaseAuction_12_list struct { + list *[]*timestamppb.Timestamp +} + +func (x *_BaseAuction_12_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_BaseAuction_12_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_BaseAuction_12_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*timestamppb.Timestamp) + (*x.list)[i] = concreteValue +} + +func (x *_BaseAuction_12_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*timestamppb.Timestamp) + *x.list = append(*x.list, concreteValue) +} + +func (x *_BaseAuction_12_list) AppendMutable() protoreflect.Value { + v := new(timestamppb.Timestamp) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_BaseAuction_12_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_BaseAuction_12_list) NewElement() protoreflect.Value { + v := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_BaseAuction_12_list) IsValid() bool { + return x.list != nil +} + +var ( + md_BaseAuction protoreflect.MessageDescriptor + fd_BaseAuction_id protoreflect.FieldDescriptor + fd_BaseAuction_type protoreflect.FieldDescriptor + fd_BaseAuction_auctioneer protoreflect.FieldDescriptor + fd_BaseAuction_selling_reserve_address protoreflect.FieldDescriptor + fd_BaseAuction_paying_reserve_address protoreflect.FieldDescriptor + fd_BaseAuction_start_price protoreflect.FieldDescriptor + fd_BaseAuction_selling_coin protoreflect.FieldDescriptor + fd_BaseAuction_paying_coin_denom protoreflect.FieldDescriptor + fd_BaseAuction_vesting_reserve_address protoreflect.FieldDescriptor + fd_BaseAuction_vesting_schedules protoreflect.FieldDescriptor + fd_BaseAuction_start_time protoreflect.FieldDescriptor + fd_BaseAuction_end_times protoreflect.FieldDescriptor + fd_BaseAuction_status protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_auction_proto_init() + md_BaseAuction = File_fundraising_fundraising_v1_auction_proto.Messages().ByName("BaseAuction") + fd_BaseAuction_id = md_BaseAuction.Fields().ByName("id") + fd_BaseAuction_type = md_BaseAuction.Fields().ByName("type") + fd_BaseAuction_auctioneer = md_BaseAuction.Fields().ByName("auctioneer") + fd_BaseAuction_selling_reserve_address = md_BaseAuction.Fields().ByName("selling_reserve_address") + fd_BaseAuction_paying_reserve_address = md_BaseAuction.Fields().ByName("paying_reserve_address") + fd_BaseAuction_start_price = md_BaseAuction.Fields().ByName("start_price") + fd_BaseAuction_selling_coin = md_BaseAuction.Fields().ByName("selling_coin") + fd_BaseAuction_paying_coin_denom = md_BaseAuction.Fields().ByName("paying_coin_denom") + fd_BaseAuction_vesting_reserve_address = md_BaseAuction.Fields().ByName("vesting_reserve_address") + fd_BaseAuction_vesting_schedules = md_BaseAuction.Fields().ByName("vesting_schedules") + fd_BaseAuction_start_time = md_BaseAuction.Fields().ByName("start_time") + fd_BaseAuction_end_times = md_BaseAuction.Fields().ByName("end_times") + fd_BaseAuction_status = md_BaseAuction.Fields().ByName("status") +} + +var _ protoreflect.Message = (*fastReflection_BaseAuction)(nil) + +type fastReflection_BaseAuction BaseAuction + +func (x *BaseAuction) ProtoReflect() protoreflect.Message { + return (*fastReflection_BaseAuction)(x) +} + +func (x *BaseAuction) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_auction_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_BaseAuction_messageType fastReflection_BaseAuction_messageType + _ protoreflect.MessageType = fastReflection_BaseAuction_messageType{} +) + +type fastReflection_BaseAuction_messageType struct{} + +func (x fastReflection_BaseAuction_messageType) Zero() protoreflect.Message { + return (*fastReflection_BaseAuction)(nil) +} + +func (x fastReflection_BaseAuction_messageType) New() protoreflect.Message { + return new(fastReflection_BaseAuction) +} + +func (x fastReflection_BaseAuction_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_BaseAuction +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_BaseAuction) Descriptor() protoreflect.MessageDescriptor { + return md_BaseAuction +} + +// 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_BaseAuction) Type() protoreflect.MessageType { + return _fastReflection_BaseAuction_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_BaseAuction) New() protoreflect.Message { + return new(fastReflection_BaseAuction) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_BaseAuction) Interface() protoreflect.ProtoMessage { + return (*BaseAuction)(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_BaseAuction) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != uint64(0) { + value := protoreflect.ValueOfUint64(x.Id) + if !f(fd_BaseAuction_id, value) { + return + } + } + if x.Type_ != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Type_)) + if !f(fd_BaseAuction_type, value) { + return + } + } + if x.Auctioneer != "" { + value := protoreflect.ValueOfString(x.Auctioneer) + if !f(fd_BaseAuction_auctioneer, value) { + return + } + } + if x.SellingReserveAddress != "" { + value := protoreflect.ValueOfString(x.SellingReserveAddress) + if !f(fd_BaseAuction_selling_reserve_address, value) { + return + } + } + if x.PayingReserveAddress != "" { + value := protoreflect.ValueOfString(x.PayingReserveAddress) + if !f(fd_BaseAuction_paying_reserve_address, value) { + return + } + } + if x.StartPrice != "" { + value := protoreflect.ValueOfString(x.StartPrice) + if !f(fd_BaseAuction_start_price, value) { + return + } + } + if x.SellingCoin != nil { + value := protoreflect.ValueOfMessage(x.SellingCoin.ProtoReflect()) + if !f(fd_BaseAuction_selling_coin, value) { + return + } + } + if x.PayingCoinDenom != "" { + value := protoreflect.ValueOfString(x.PayingCoinDenom) + if !f(fd_BaseAuction_paying_coin_denom, value) { + return + } + } + if x.VestingReserveAddress != "" { + value := protoreflect.ValueOfString(x.VestingReserveAddress) + if !f(fd_BaseAuction_vesting_reserve_address, value) { + return + } + } + if len(x.VestingSchedules) != 0 { + value := protoreflect.ValueOfList(&_BaseAuction_10_list{list: &x.VestingSchedules}) + if !f(fd_BaseAuction_vesting_schedules, value) { + return + } + } + if x.StartTime != nil { + value := protoreflect.ValueOfMessage(x.StartTime.ProtoReflect()) + if !f(fd_BaseAuction_start_time, value) { + return + } + } + if len(x.EndTimes) != 0 { + value := protoreflect.ValueOfList(&_BaseAuction_12_list{list: &x.EndTimes}) + if !f(fd_BaseAuction_end_times, value) { + return + } + } + if x.Status != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Status)) + if !f(fd_BaseAuction_status, 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_BaseAuction) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.BaseAuction.id": + return x.Id != uint64(0) + case "fundraising.fundraising.v1.BaseAuction.type": + return x.Type_ != 0 + case "fundraising.fundraising.v1.BaseAuction.auctioneer": + return x.Auctioneer != "" + case "fundraising.fundraising.v1.BaseAuction.selling_reserve_address": + return x.SellingReserveAddress != "" + case "fundraising.fundraising.v1.BaseAuction.paying_reserve_address": + return x.PayingReserveAddress != "" + case "fundraising.fundraising.v1.BaseAuction.start_price": + return x.StartPrice != "" + case "fundraising.fundraising.v1.BaseAuction.selling_coin": + return x.SellingCoin != nil + case "fundraising.fundraising.v1.BaseAuction.paying_coin_denom": + return x.PayingCoinDenom != "" + case "fundraising.fundraising.v1.BaseAuction.vesting_reserve_address": + return x.VestingReserveAddress != "" + case "fundraising.fundraising.v1.BaseAuction.vesting_schedules": + return len(x.VestingSchedules) != 0 + case "fundraising.fundraising.v1.BaseAuction.start_time": + return x.StartTime != nil + case "fundraising.fundraising.v1.BaseAuction.end_times": + return len(x.EndTimes) != 0 + case "fundraising.fundraising.v1.BaseAuction.status": + return x.Status != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.BaseAuction")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.BaseAuction 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_BaseAuction) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.BaseAuction.id": + x.Id = uint64(0) + case "fundraising.fundraising.v1.BaseAuction.type": + x.Type_ = 0 + case "fundraising.fundraising.v1.BaseAuction.auctioneer": + x.Auctioneer = "" + case "fundraising.fundraising.v1.BaseAuction.selling_reserve_address": + x.SellingReserveAddress = "" + case "fundraising.fundraising.v1.BaseAuction.paying_reserve_address": + x.PayingReserveAddress = "" + case "fundraising.fundraising.v1.BaseAuction.start_price": + x.StartPrice = "" + case "fundraising.fundraising.v1.BaseAuction.selling_coin": + x.SellingCoin = nil + case "fundraising.fundraising.v1.BaseAuction.paying_coin_denom": + x.PayingCoinDenom = "" + case "fundraising.fundraising.v1.BaseAuction.vesting_reserve_address": + x.VestingReserveAddress = "" + case "fundraising.fundraising.v1.BaseAuction.vesting_schedules": + x.VestingSchedules = nil + case "fundraising.fundraising.v1.BaseAuction.start_time": + x.StartTime = nil + case "fundraising.fundraising.v1.BaseAuction.end_times": + x.EndTimes = nil + case "fundraising.fundraising.v1.BaseAuction.status": + x.Status = 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.BaseAuction")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.BaseAuction 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_BaseAuction) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.BaseAuction.id": + value := x.Id + return protoreflect.ValueOfUint64(value) + case "fundraising.fundraising.v1.BaseAuction.type": + value := x.Type_ + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "fundraising.fundraising.v1.BaseAuction.auctioneer": + value := x.Auctioneer + return protoreflect.ValueOfString(value) + case "fundraising.fundraising.v1.BaseAuction.selling_reserve_address": + value := x.SellingReserveAddress + return protoreflect.ValueOfString(value) + case "fundraising.fundraising.v1.BaseAuction.paying_reserve_address": + value := x.PayingReserveAddress + return protoreflect.ValueOfString(value) + case "fundraising.fundraising.v1.BaseAuction.start_price": + value := x.StartPrice + return protoreflect.ValueOfString(value) + case "fundraising.fundraising.v1.BaseAuction.selling_coin": + value := x.SellingCoin + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "fundraising.fundraising.v1.BaseAuction.paying_coin_denom": + value := x.PayingCoinDenom + return protoreflect.ValueOfString(value) + case "fundraising.fundraising.v1.BaseAuction.vesting_reserve_address": + value := x.VestingReserveAddress + return protoreflect.ValueOfString(value) + case "fundraising.fundraising.v1.BaseAuction.vesting_schedules": + if len(x.VestingSchedules) == 0 { + return protoreflect.ValueOfList(&_BaseAuction_10_list{}) + } + listValue := &_BaseAuction_10_list{list: &x.VestingSchedules} + return protoreflect.ValueOfList(listValue) + case "fundraising.fundraising.v1.BaseAuction.start_time": + value := x.StartTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "fundraising.fundraising.v1.BaseAuction.end_times": + if len(x.EndTimes) == 0 { + return protoreflect.ValueOfList(&_BaseAuction_12_list{}) + } + listValue := &_BaseAuction_12_list{list: &x.EndTimes} + return protoreflect.ValueOfList(listValue) + case "fundraising.fundraising.v1.BaseAuction.status": + value := x.Status + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.BaseAuction")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.BaseAuction 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_BaseAuction) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.BaseAuction.id": + x.Id = value.Uint() + case "fundraising.fundraising.v1.BaseAuction.type": + x.Type_ = (AuctionType)(value.Enum()) + case "fundraising.fundraising.v1.BaseAuction.auctioneer": + x.Auctioneer = value.Interface().(string) + case "fundraising.fundraising.v1.BaseAuction.selling_reserve_address": + x.SellingReserveAddress = value.Interface().(string) + case "fundraising.fundraising.v1.BaseAuction.paying_reserve_address": + x.PayingReserveAddress = value.Interface().(string) + case "fundraising.fundraising.v1.BaseAuction.start_price": + x.StartPrice = value.Interface().(string) + case "fundraising.fundraising.v1.BaseAuction.selling_coin": + x.SellingCoin = value.Message().Interface().(*v1beta1.Coin) + case "fundraising.fundraising.v1.BaseAuction.paying_coin_denom": + x.PayingCoinDenom = value.Interface().(string) + case "fundraising.fundraising.v1.BaseAuction.vesting_reserve_address": + x.VestingReserveAddress = value.Interface().(string) + case "fundraising.fundraising.v1.BaseAuction.vesting_schedules": + lv := value.List() + clv := lv.(*_BaseAuction_10_list) + x.VestingSchedules = *clv.list + case "fundraising.fundraising.v1.BaseAuction.start_time": + x.StartTime = value.Message().Interface().(*timestamppb.Timestamp) + case "fundraising.fundraising.v1.BaseAuction.end_times": + lv := value.List() + clv := lv.(*_BaseAuction_12_list) + x.EndTimes = *clv.list + case "fundraising.fundraising.v1.BaseAuction.status": + x.Status = (AuctionStatus)(value.Enum()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.BaseAuction")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.BaseAuction 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_BaseAuction) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.BaseAuction.selling_coin": + if x.SellingCoin == nil { + x.SellingCoin = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.SellingCoin.ProtoReflect()) + case "fundraising.fundraising.v1.BaseAuction.vesting_schedules": + if x.VestingSchedules == nil { + x.VestingSchedules = []*VestingSchedule{} + } + value := &_BaseAuction_10_list{list: &x.VestingSchedules} + return protoreflect.ValueOfList(value) + case "fundraising.fundraising.v1.BaseAuction.start_time": + if x.StartTime == nil { + x.StartTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.StartTime.ProtoReflect()) + case "fundraising.fundraising.v1.BaseAuction.end_times": + if x.EndTimes == nil { + x.EndTimes = []*timestamppb.Timestamp{} + } + value := &_BaseAuction_12_list{list: &x.EndTimes} + return protoreflect.ValueOfList(value) + case "fundraising.fundraising.v1.BaseAuction.id": + panic(fmt.Errorf("field id of message fundraising.fundraising.v1.BaseAuction is not mutable")) + case "fundraising.fundraising.v1.BaseAuction.type": + panic(fmt.Errorf("field type of message fundraising.fundraising.v1.BaseAuction is not mutable")) + case "fundraising.fundraising.v1.BaseAuction.auctioneer": + panic(fmt.Errorf("field auctioneer of message fundraising.fundraising.v1.BaseAuction is not mutable")) + case "fundraising.fundraising.v1.BaseAuction.selling_reserve_address": + panic(fmt.Errorf("field selling_reserve_address of message fundraising.fundraising.v1.BaseAuction is not mutable")) + case "fundraising.fundraising.v1.BaseAuction.paying_reserve_address": + panic(fmt.Errorf("field paying_reserve_address of message fundraising.fundraising.v1.BaseAuction is not mutable")) + case "fundraising.fundraising.v1.BaseAuction.start_price": + panic(fmt.Errorf("field start_price of message fundraising.fundraising.v1.BaseAuction is not mutable")) + case "fundraising.fundraising.v1.BaseAuction.paying_coin_denom": + panic(fmt.Errorf("field paying_coin_denom of message fundraising.fundraising.v1.BaseAuction is not mutable")) + case "fundraising.fundraising.v1.BaseAuction.vesting_reserve_address": + panic(fmt.Errorf("field vesting_reserve_address of message fundraising.fundraising.v1.BaseAuction is not mutable")) + case "fundraising.fundraising.v1.BaseAuction.status": + panic(fmt.Errorf("field status of message fundraising.fundraising.v1.BaseAuction is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.BaseAuction")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.BaseAuction 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_BaseAuction) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.BaseAuction.id": + return protoreflect.ValueOfUint64(uint64(0)) + case "fundraising.fundraising.v1.BaseAuction.type": + return protoreflect.ValueOfEnum(0) + case "fundraising.fundraising.v1.BaseAuction.auctioneer": + return protoreflect.ValueOfString("") + case "fundraising.fundraising.v1.BaseAuction.selling_reserve_address": + return protoreflect.ValueOfString("") + case "fundraising.fundraising.v1.BaseAuction.paying_reserve_address": + return protoreflect.ValueOfString("") + case "fundraising.fundraising.v1.BaseAuction.start_price": + return protoreflect.ValueOfString("") + case "fundraising.fundraising.v1.BaseAuction.selling_coin": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "fundraising.fundraising.v1.BaseAuction.paying_coin_denom": + return protoreflect.ValueOfString("") + case "fundraising.fundraising.v1.BaseAuction.vesting_reserve_address": + return protoreflect.ValueOfString("") + case "fundraising.fundraising.v1.BaseAuction.vesting_schedules": + list := []*VestingSchedule{} + return protoreflect.ValueOfList(&_BaseAuction_10_list{list: &list}) + case "fundraising.fundraising.v1.BaseAuction.start_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "fundraising.fundraising.v1.BaseAuction.end_times": + list := []*timestamppb.Timestamp{} + return protoreflect.ValueOfList(&_BaseAuction_12_list{list: &list}) + case "fundraising.fundraising.v1.BaseAuction.status": + return protoreflect.ValueOfEnum(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.BaseAuction")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.BaseAuction 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_BaseAuction) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.BaseAuction", 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_BaseAuction) 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_BaseAuction) 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_BaseAuction) 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_BaseAuction) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*BaseAuction) + 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.Type_ != 0 { + n += 1 + runtime.Sov(uint64(x.Type_)) + } + l = len(x.Auctioneer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.SellingReserveAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PayingReserveAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.StartPrice) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.SellingCoin != nil { + l = options.Size(x.SellingCoin) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PayingCoinDenom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.VestingReserveAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.VestingSchedules) > 0 { + for _, e := range x.VestingSchedules { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.StartTime != nil { + l = options.Size(x.StartTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.EndTimes) > 0 { + for _, e := range x.EndTimes { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Status != 0 { + n += 1 + runtime.Sov(uint64(x.Status)) + } + 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().(*BaseAuction) + 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.Status != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Status)) + i-- + dAtA[i] = 0x68 + } + if len(x.EndTimes) > 0 { + for iNdEx := len(x.EndTimes) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.EndTimes[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] = 0x62 + } + } + 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] = 0x5a + } + if len(x.VestingSchedules) > 0 { + for iNdEx := len(x.VestingSchedules) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.VestingSchedules[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] = 0x52 + } + } + if len(x.VestingReserveAddress) > 0 { + i -= len(x.VestingReserveAddress) + copy(dAtA[i:], x.VestingReserveAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VestingReserveAddress))) + i-- + dAtA[i] = 0x4a + } + if len(x.PayingCoinDenom) > 0 { + i -= len(x.PayingCoinDenom) + copy(dAtA[i:], x.PayingCoinDenom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PayingCoinDenom))) + i-- + dAtA[i] = 0x42 + } + if x.SellingCoin != nil { + encoded, err := options.Marshal(x.SellingCoin) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x3a + } + if len(x.StartPrice) > 0 { + i -= len(x.StartPrice) + copy(dAtA[i:], x.StartPrice) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.StartPrice))) + i-- + dAtA[i] = 0x32 + } + if len(x.PayingReserveAddress) > 0 { + i -= len(x.PayingReserveAddress) + copy(dAtA[i:], x.PayingReserveAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PayingReserveAddress))) + i-- + dAtA[i] = 0x2a + } + if len(x.SellingReserveAddress) > 0 { + i -= len(x.SellingReserveAddress) + copy(dAtA[i:], x.SellingReserveAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SellingReserveAddress))) + i-- + dAtA[i] = 0x22 + } + if len(x.Auctioneer) > 0 { + i -= len(x.Auctioneer) + copy(dAtA[i:], x.Auctioneer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Auctioneer))) + i-- + dAtA[i] = 0x1a + } + if x.Type_ != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Type_)) + i-- + dAtA[i] = 0x10 + } + 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().(*BaseAuction) + 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: BaseAuction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BaseAuction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + x.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Type_", wireType) + } + x.Type_ = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Type_ |= AuctionType(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 Auctioneer", 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.Auctioneer = 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 SellingReserveAddress", 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.SellingReserveAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PayingReserveAddress", 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.PayingReserveAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StartPrice", 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.StartPrice = 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 SellingCoin", 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.SellingCoin == nil { + x.SellingCoin = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.SellingCoin); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PayingCoinDenom", 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.PayingCoinDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VestingReserveAddress", 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.VestingReserveAddress = 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 VestingSchedules", 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.VestingSchedules = append(x.VestingSchedules, &VestingSchedule{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VestingSchedules[len(x.VestingSchedules)-1]); err != nil { + 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 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 12: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EndTimes", 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.EndTimes = append(x.EndTimes, ×tamppb.Timestamp{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.EndTimes[len(x.EndTimes)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 13: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + x.Status = 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.Status |= AuctionStatus(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_FixedPriceAuction protoreflect.MessageDescriptor + fd_FixedPriceAuction_base_auction protoreflect.FieldDescriptor + fd_FixedPriceAuction_remaining_selling_coin protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_auction_proto_init() + md_FixedPriceAuction = File_fundraising_fundraising_v1_auction_proto.Messages().ByName("FixedPriceAuction") + fd_FixedPriceAuction_base_auction = md_FixedPriceAuction.Fields().ByName("base_auction") + fd_FixedPriceAuction_remaining_selling_coin = md_FixedPriceAuction.Fields().ByName("remaining_selling_coin") +} + +var _ protoreflect.Message = (*fastReflection_FixedPriceAuction)(nil) + +type fastReflection_FixedPriceAuction FixedPriceAuction + +func (x *FixedPriceAuction) ProtoReflect() protoreflect.Message { + return (*fastReflection_FixedPriceAuction)(x) +} + +func (x *FixedPriceAuction) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_auction_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_FixedPriceAuction_messageType fastReflection_FixedPriceAuction_messageType + _ protoreflect.MessageType = fastReflection_FixedPriceAuction_messageType{} +) + +type fastReflection_FixedPriceAuction_messageType struct{} + +func (x fastReflection_FixedPriceAuction_messageType) Zero() protoreflect.Message { + return (*fastReflection_FixedPriceAuction)(nil) +} + +func (x fastReflection_FixedPriceAuction_messageType) New() protoreflect.Message { + return new(fastReflection_FixedPriceAuction) +} + +func (x fastReflection_FixedPriceAuction_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_FixedPriceAuction +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_FixedPriceAuction) Descriptor() protoreflect.MessageDescriptor { + return md_FixedPriceAuction +} + +// 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_FixedPriceAuction) Type() protoreflect.MessageType { + return _fastReflection_FixedPriceAuction_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_FixedPriceAuction) New() protoreflect.Message { + return new(fastReflection_FixedPriceAuction) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_FixedPriceAuction) Interface() protoreflect.ProtoMessage { + return (*FixedPriceAuction)(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_FixedPriceAuction) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.BaseAuction != nil { + value := protoreflect.ValueOfMessage(x.BaseAuction.ProtoReflect()) + if !f(fd_FixedPriceAuction_base_auction, value) { + return + } + } + if x.RemainingSellingCoin != nil { + value := protoreflect.ValueOfMessage(x.RemainingSellingCoin.ProtoReflect()) + if !f(fd_FixedPriceAuction_remaining_selling_coin, 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_FixedPriceAuction) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.FixedPriceAuction.base_auction": + return x.BaseAuction != nil + case "fundraising.fundraising.v1.FixedPriceAuction.remaining_selling_coin": + return x.RemainingSellingCoin != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.FixedPriceAuction")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.FixedPriceAuction 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_FixedPriceAuction) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.FixedPriceAuction.base_auction": + x.BaseAuction = nil + case "fundraising.fundraising.v1.FixedPriceAuction.remaining_selling_coin": + x.RemainingSellingCoin = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.FixedPriceAuction")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.FixedPriceAuction 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_FixedPriceAuction) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.FixedPriceAuction.base_auction": + value := x.BaseAuction + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "fundraising.fundraising.v1.FixedPriceAuction.remaining_selling_coin": + value := x.RemainingSellingCoin + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.FixedPriceAuction")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.FixedPriceAuction 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_FixedPriceAuction) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.FixedPriceAuction.base_auction": + x.BaseAuction = value.Message().Interface().(*BaseAuction) + case "fundraising.fundraising.v1.FixedPriceAuction.remaining_selling_coin": + x.RemainingSellingCoin = value.Message().Interface().(*v1beta1.Coin) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.FixedPriceAuction")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.FixedPriceAuction 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_FixedPriceAuction) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.FixedPriceAuction.base_auction": + if x.BaseAuction == nil { + x.BaseAuction = new(BaseAuction) + } + return protoreflect.ValueOfMessage(x.BaseAuction.ProtoReflect()) + case "fundraising.fundraising.v1.FixedPriceAuction.remaining_selling_coin": + if x.RemainingSellingCoin == nil { + x.RemainingSellingCoin = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.RemainingSellingCoin.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.FixedPriceAuction")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.FixedPriceAuction 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_FixedPriceAuction) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.FixedPriceAuction.base_auction": + m := new(BaseAuction) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "fundraising.fundraising.v1.FixedPriceAuction.remaining_selling_coin": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.FixedPriceAuction")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.FixedPriceAuction 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_FixedPriceAuction) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.FixedPriceAuction", 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_FixedPriceAuction) 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_FixedPriceAuction) 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_FixedPriceAuction) 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_FixedPriceAuction) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*FixedPriceAuction) + 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.BaseAuction != nil { + l = options.Size(x.BaseAuction) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.RemainingSellingCoin != nil { + l = options.Size(x.RemainingSellingCoin) + 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().(*FixedPriceAuction) + 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.RemainingSellingCoin != nil { + encoded, err := options.Marshal(x.RemainingSellingCoin) + 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.BaseAuction != nil { + encoded, err := options.Marshal(x.BaseAuction) + 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().(*FixedPriceAuction) + 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: FixedPriceAuction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: FixedPriceAuction: 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 BaseAuction", 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.BaseAuction == nil { + x.BaseAuction = &BaseAuction{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.BaseAuction); 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 RemainingSellingCoin", 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.RemainingSellingCoin == nil { + x.RemainingSellingCoin = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.RemainingSellingCoin); 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_BatchAuction protoreflect.MessageDescriptor + fd_BatchAuction_base_auction protoreflect.FieldDescriptor + fd_BatchAuction_min_bid_price protoreflect.FieldDescriptor + fd_BatchAuction_matched_price protoreflect.FieldDescriptor + fd_BatchAuction_max_extended_round protoreflect.FieldDescriptor + fd_BatchAuction_extended_round_rate protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_auction_proto_init() + md_BatchAuction = File_fundraising_fundraising_v1_auction_proto.Messages().ByName("BatchAuction") + fd_BatchAuction_base_auction = md_BatchAuction.Fields().ByName("base_auction") + fd_BatchAuction_min_bid_price = md_BatchAuction.Fields().ByName("min_bid_price") + fd_BatchAuction_matched_price = md_BatchAuction.Fields().ByName("matched_price") + fd_BatchAuction_max_extended_round = md_BatchAuction.Fields().ByName("max_extended_round") + fd_BatchAuction_extended_round_rate = md_BatchAuction.Fields().ByName("extended_round_rate") +} + +var _ protoreflect.Message = (*fastReflection_BatchAuction)(nil) + +type fastReflection_BatchAuction BatchAuction + +func (x *BatchAuction) ProtoReflect() protoreflect.Message { + return (*fastReflection_BatchAuction)(x) +} + +func (x *BatchAuction) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_auction_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_BatchAuction_messageType fastReflection_BatchAuction_messageType + _ protoreflect.MessageType = fastReflection_BatchAuction_messageType{} +) + +type fastReflection_BatchAuction_messageType struct{} + +func (x fastReflection_BatchAuction_messageType) Zero() protoreflect.Message { + return (*fastReflection_BatchAuction)(nil) +} + +func (x fastReflection_BatchAuction_messageType) New() protoreflect.Message { + return new(fastReflection_BatchAuction) +} + +func (x fastReflection_BatchAuction_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_BatchAuction +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_BatchAuction) Descriptor() protoreflect.MessageDescriptor { + return md_BatchAuction +} + +// 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_BatchAuction) Type() protoreflect.MessageType { + return _fastReflection_BatchAuction_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_BatchAuction) New() protoreflect.Message { + return new(fastReflection_BatchAuction) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_BatchAuction) Interface() protoreflect.ProtoMessage { + return (*BatchAuction)(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_BatchAuction) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.BaseAuction != nil { + value := protoreflect.ValueOfMessage(x.BaseAuction.ProtoReflect()) + if !f(fd_BatchAuction_base_auction, value) { + return + } + } + if x.MinBidPrice != "" { + value := protoreflect.ValueOfString(x.MinBidPrice) + if !f(fd_BatchAuction_min_bid_price, value) { + return + } + } + if x.MatchedPrice != "" { + value := protoreflect.ValueOfString(x.MatchedPrice) + if !f(fd_BatchAuction_matched_price, value) { + return + } + } + if x.MaxExtendedRound != uint32(0) { + value := protoreflect.ValueOfUint32(x.MaxExtendedRound) + if !f(fd_BatchAuction_max_extended_round, value) { + return + } + } + if x.ExtendedRoundRate != "" { + value := protoreflect.ValueOfString(x.ExtendedRoundRate) + if !f(fd_BatchAuction_extended_round_rate, 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_BatchAuction) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.BatchAuction.base_auction": + return x.BaseAuction != nil + case "fundraising.fundraising.v1.BatchAuction.min_bid_price": + return x.MinBidPrice != "" + case "fundraising.fundraising.v1.BatchAuction.matched_price": + return x.MatchedPrice != "" + case "fundraising.fundraising.v1.BatchAuction.max_extended_round": + return x.MaxExtendedRound != uint32(0) + case "fundraising.fundraising.v1.BatchAuction.extended_round_rate": + return x.ExtendedRoundRate != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.BatchAuction")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.BatchAuction 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_BatchAuction) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.BatchAuction.base_auction": + x.BaseAuction = nil + case "fundraising.fundraising.v1.BatchAuction.min_bid_price": + x.MinBidPrice = "" + case "fundraising.fundraising.v1.BatchAuction.matched_price": + x.MatchedPrice = "" + case "fundraising.fundraising.v1.BatchAuction.max_extended_round": + x.MaxExtendedRound = uint32(0) + case "fundraising.fundraising.v1.BatchAuction.extended_round_rate": + x.ExtendedRoundRate = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.BatchAuction")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.BatchAuction 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_BatchAuction) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.BatchAuction.base_auction": + value := x.BaseAuction + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "fundraising.fundraising.v1.BatchAuction.min_bid_price": + value := x.MinBidPrice + return protoreflect.ValueOfString(value) + case "fundraising.fundraising.v1.BatchAuction.matched_price": + value := x.MatchedPrice + return protoreflect.ValueOfString(value) + case "fundraising.fundraising.v1.BatchAuction.max_extended_round": + value := x.MaxExtendedRound + return protoreflect.ValueOfUint32(value) + case "fundraising.fundraising.v1.BatchAuction.extended_round_rate": + value := x.ExtendedRoundRate + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.BatchAuction")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.BatchAuction 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_BatchAuction) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.BatchAuction.base_auction": + x.BaseAuction = value.Message().Interface().(*BaseAuction) + case "fundraising.fundraising.v1.BatchAuction.min_bid_price": + x.MinBidPrice = value.Interface().(string) + case "fundraising.fundraising.v1.BatchAuction.matched_price": + x.MatchedPrice = value.Interface().(string) + case "fundraising.fundraising.v1.BatchAuction.max_extended_round": + x.MaxExtendedRound = uint32(value.Uint()) + case "fundraising.fundraising.v1.BatchAuction.extended_round_rate": + x.ExtendedRoundRate = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.BatchAuction")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.BatchAuction 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_BatchAuction) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.BatchAuction.base_auction": + if x.BaseAuction == nil { + x.BaseAuction = new(BaseAuction) + } + return protoreflect.ValueOfMessage(x.BaseAuction.ProtoReflect()) + case "fundraising.fundraising.v1.BatchAuction.min_bid_price": + panic(fmt.Errorf("field min_bid_price of message fundraising.fundraising.v1.BatchAuction is not mutable")) + case "fundraising.fundraising.v1.BatchAuction.matched_price": + panic(fmt.Errorf("field matched_price of message fundraising.fundraising.v1.BatchAuction is not mutable")) + case "fundraising.fundraising.v1.BatchAuction.max_extended_round": + panic(fmt.Errorf("field max_extended_round of message fundraising.fundraising.v1.BatchAuction is not mutable")) + case "fundraising.fundraising.v1.BatchAuction.extended_round_rate": + panic(fmt.Errorf("field extended_round_rate of message fundraising.fundraising.v1.BatchAuction is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.BatchAuction")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.BatchAuction 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_BatchAuction) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.BatchAuction.base_auction": + m := new(BaseAuction) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "fundraising.fundraising.v1.BatchAuction.min_bid_price": + return protoreflect.ValueOfString("") + case "fundraising.fundraising.v1.BatchAuction.matched_price": + return protoreflect.ValueOfString("") + case "fundraising.fundraising.v1.BatchAuction.max_extended_round": + return protoreflect.ValueOfUint32(uint32(0)) + case "fundraising.fundraising.v1.BatchAuction.extended_round_rate": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.BatchAuction")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.BatchAuction 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_BatchAuction) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.BatchAuction", 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_BatchAuction) 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_BatchAuction) 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_BatchAuction) 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_BatchAuction) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*BatchAuction) + 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.BaseAuction != nil { + l = options.Size(x.BaseAuction) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.MinBidPrice) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.MatchedPrice) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.MaxExtendedRound != 0 { + n += 1 + runtime.Sov(uint64(x.MaxExtendedRound)) + } + l = len(x.ExtendedRoundRate) + 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().(*BatchAuction) + 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.ExtendedRoundRate) > 0 { + i -= len(x.ExtendedRoundRate) + copy(dAtA[i:], x.ExtendedRoundRate) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ExtendedRoundRate))) + i-- + dAtA[i] = 0x2a + } + if x.MaxExtendedRound != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxExtendedRound)) + i-- + dAtA[i] = 0x20 + } + if len(x.MatchedPrice) > 0 { + i -= len(x.MatchedPrice) + copy(dAtA[i:], x.MatchedPrice) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MatchedPrice))) + i-- + dAtA[i] = 0x1a + } + if len(x.MinBidPrice) > 0 { + i -= len(x.MinBidPrice) + copy(dAtA[i:], x.MinBidPrice) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MinBidPrice))) + i-- + dAtA[i] = 0x12 + } + if x.BaseAuction != nil { + encoded, err := options.Marshal(x.BaseAuction) + 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().(*BatchAuction) + 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: BatchAuction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BatchAuction: 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 BaseAuction", 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.BaseAuction == nil { + x.BaseAuction = &BaseAuction{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.BaseAuction); 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 MinBidPrice", 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.MinBidPrice = 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 MatchedPrice", 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.MatchedPrice = 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 MaxExtendedRound", wireType) + } + x.MaxExtendedRound = 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.MaxExtendedRound |= uint32(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 ExtendedRoundRate", 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.ExtendedRoundRate = 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_VestingSchedule protoreflect.MessageDescriptor + fd_VestingSchedule_release_time protoreflect.FieldDescriptor + fd_VestingSchedule_weight protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_auction_proto_init() + md_VestingSchedule = File_fundraising_fundraising_v1_auction_proto.Messages().ByName("VestingSchedule") + fd_VestingSchedule_release_time = md_VestingSchedule.Fields().ByName("release_time") + fd_VestingSchedule_weight = md_VestingSchedule.Fields().ByName("weight") +} + +var _ protoreflect.Message = (*fastReflection_VestingSchedule)(nil) + +type fastReflection_VestingSchedule VestingSchedule + +func (x *VestingSchedule) ProtoReflect() protoreflect.Message { + return (*fastReflection_VestingSchedule)(x) +} + +func (x *VestingSchedule) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_auction_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_VestingSchedule_messageType fastReflection_VestingSchedule_messageType + _ protoreflect.MessageType = fastReflection_VestingSchedule_messageType{} +) + +type fastReflection_VestingSchedule_messageType struct{} + +func (x fastReflection_VestingSchedule_messageType) Zero() protoreflect.Message { + return (*fastReflection_VestingSchedule)(nil) +} + +func (x fastReflection_VestingSchedule_messageType) New() protoreflect.Message { + return new(fastReflection_VestingSchedule) +} + +func (x fastReflection_VestingSchedule_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_VestingSchedule +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_VestingSchedule) Descriptor() protoreflect.MessageDescriptor { + return md_VestingSchedule +} + +// 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_VestingSchedule) Type() protoreflect.MessageType { + return _fastReflection_VestingSchedule_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_VestingSchedule) New() protoreflect.Message { + return new(fastReflection_VestingSchedule) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_VestingSchedule) Interface() protoreflect.ProtoMessage { + return (*VestingSchedule)(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_VestingSchedule) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ReleaseTime != nil { + value := protoreflect.ValueOfMessage(x.ReleaseTime.ProtoReflect()) + if !f(fd_VestingSchedule_release_time, value) { + return + } + } + if x.Weight != "" { + value := protoreflect.ValueOfString(x.Weight) + if !f(fd_VestingSchedule_weight, 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_VestingSchedule) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.VestingSchedule.release_time": + return x.ReleaseTime != nil + case "fundraising.fundraising.v1.VestingSchedule.weight": + return x.Weight != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.VestingSchedule")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.VestingSchedule 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_VestingSchedule) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.VestingSchedule.release_time": + x.ReleaseTime = nil + case "fundraising.fundraising.v1.VestingSchedule.weight": + x.Weight = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.VestingSchedule")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.VestingSchedule 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_VestingSchedule) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.VestingSchedule.release_time": + value := x.ReleaseTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "fundraising.fundraising.v1.VestingSchedule.weight": + value := x.Weight + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.VestingSchedule")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.VestingSchedule 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_VestingSchedule) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.VestingSchedule.release_time": + x.ReleaseTime = value.Message().Interface().(*timestamppb.Timestamp) + case "fundraising.fundraising.v1.VestingSchedule.weight": + x.Weight = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.VestingSchedule")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.VestingSchedule 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_VestingSchedule) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.VestingSchedule.release_time": + if x.ReleaseTime == nil { + x.ReleaseTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.ReleaseTime.ProtoReflect()) + case "fundraising.fundraising.v1.VestingSchedule.weight": + panic(fmt.Errorf("field weight of message fundraising.fundraising.v1.VestingSchedule is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.VestingSchedule")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.VestingSchedule 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_VestingSchedule) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.VestingSchedule.release_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "fundraising.fundraising.v1.VestingSchedule.weight": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.VestingSchedule")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.VestingSchedule 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_VestingSchedule) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.VestingSchedule", 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_VestingSchedule) 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_VestingSchedule) 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_VestingSchedule) 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_VestingSchedule) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*VestingSchedule) + 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.ReleaseTime != nil { + l = options.Size(x.ReleaseTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Weight) + 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().(*VestingSchedule) + 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.Weight) > 0 { + i -= len(x.Weight) + copy(dAtA[i:], x.Weight) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Weight))) + i-- + dAtA[i] = 0x12 + } + if x.ReleaseTime != nil { + encoded, err := options.Marshal(x.ReleaseTime) + 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().(*VestingSchedule) + 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: VestingSchedule: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: VestingSchedule: 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 ReleaseTime", 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.ReleaseTime == nil { + x.ReleaseTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ReleaseTime); 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 Weight", 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.Weight = 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: fundraising/fundraising/v1/auction.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) +) + +// AuctionType enumerates the valid types of an auction. +type AuctionType int32 + +const ( + // AUCTION_TYPE_UNSPECIFIED defines the default auction type + AuctionType_AUCTION_TYPE_UNSPECIFIED AuctionType = 0 + // AUCTION_TYPE_FIXED_PRICE defines the fixed price auction type + AuctionType_AUCTION_TYPE_FIXED_PRICE AuctionType = 1 + // AUCTION_TYPE_BATCH defines the batch auction type + AuctionType_AUCTION_TYPE_BATCH AuctionType = 2 +) + +// Enum value maps for AuctionType. +var ( + AuctionType_name = map[int32]string{ + 0: "AUCTION_TYPE_UNSPECIFIED", + 1: "AUCTION_TYPE_FIXED_PRICE", + 2: "AUCTION_TYPE_BATCH", + } + AuctionType_value = map[string]int32{ + "AUCTION_TYPE_UNSPECIFIED": 0, + "AUCTION_TYPE_FIXED_PRICE": 1, + "AUCTION_TYPE_BATCH": 2, + } +) + +func (x AuctionType) Enum() *AuctionType { + p := new(AuctionType) + *p = x + return p +} + +func (x AuctionType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AuctionType) Descriptor() protoreflect.EnumDescriptor { + return file_fundraising_fundraising_v1_auction_proto_enumTypes[0].Descriptor() +} + +func (AuctionType) Type() protoreflect.EnumType { + return &file_fundraising_fundraising_v1_auction_proto_enumTypes[0] +} + +func (x AuctionType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AuctionType.Descriptor instead. +func (AuctionType) EnumDescriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_auction_proto_rawDescGZIP(), []int{0} +} + +// AuctionStatus enumerates the valid status of an auction. +type AuctionStatus int32 + +const ( + // AUCTION_STATUS_UNSPECIFIED defines the default auction status + AuctionStatus_AUCTION_STATUS_UNSPECIFIED AuctionStatus = 0 + // AUCTION_STATUS_STANDBY defines the standby auction status + AuctionStatus_AUCTION_STATUS_STANDBY AuctionStatus = 1 + // AUCTION_STATUS_STARTED defines the started auction status + AuctionStatus_AUCTION_STATUS_STARTED AuctionStatus = 2 + // AUCTION_STATUS_VESTING defines the vesting auction status + AuctionStatus_AUCTION_STATUS_VESTING AuctionStatus = 3 + // AUCTION_STATUS_FINISHED defines the finished auction status + AuctionStatus_AUCTION_STATUS_FINISHED AuctionStatus = 4 + // AUCTION_STATUS_CANCELLED defines the cancelled auction status + AuctionStatus_AUCTION_STATUS_CANCELLED AuctionStatus = 5 +) + +// Enum value maps for AuctionStatus. +var ( + AuctionStatus_name = map[int32]string{ + 0: "AUCTION_STATUS_UNSPECIFIED", + 1: "AUCTION_STATUS_STANDBY", + 2: "AUCTION_STATUS_STARTED", + 3: "AUCTION_STATUS_VESTING", + 4: "AUCTION_STATUS_FINISHED", + 5: "AUCTION_STATUS_CANCELLED", + } + AuctionStatus_value = map[string]int32{ + "AUCTION_STATUS_UNSPECIFIED": 0, + "AUCTION_STATUS_STANDBY": 1, + "AUCTION_STATUS_STARTED": 2, + "AUCTION_STATUS_VESTING": 3, + "AUCTION_STATUS_FINISHED": 4, + "AUCTION_STATUS_CANCELLED": 5, + } +) + +func (x AuctionStatus) Enum() *AuctionStatus { + p := new(AuctionStatus) + *p = x + return p +} + +func (x AuctionStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AuctionStatus) Descriptor() protoreflect.EnumDescriptor { + return file_fundraising_fundraising_v1_auction_proto_enumTypes[1].Descriptor() +} + +func (AuctionStatus) Type() protoreflect.EnumType { + return &file_fundraising_fundraising_v1_auction_proto_enumTypes[1] +} + +func (x AuctionStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AuctionStatus.Descriptor instead. +func (AuctionStatus) EnumDescriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_auction_proto_rawDescGZIP(), []int{1} +} + +// BaseAuction defines a base auction type. It contains all the necessary fields +// for basic auction functionality. Any custom auction type should extend this +// type for additional functionality (e.g. batch auction, fixed price +// auction). +type BaseAuction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // id specifies index of the auction + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // type specifies the auction type + // type 1 is fixed price and 2 is batch auction + Type_ AuctionType `protobuf:"varint,2,opt,name=type,proto3,enum=fundraising.fundraising.v1.AuctionType" json:"type,omitempty"` + // auctioneer specifies the bech32-encoded address that creates the auction + Auctioneer string `protobuf:"bytes,3,opt,name=auctioneer,proto3" json:"auctioneer,omitempty"` + // selling_reserve_address specifies the bech32-encoded address that has all + // the selling coin + SellingReserveAddress string `protobuf:"bytes,4,opt,name=selling_reserve_address,json=sellingReserveAddress,proto3" json:"selling_reserve_address,omitempty"` + // paying_reserve_address specifies the bech32-encoded address that has all + // the paying coin + PayingReserveAddress string `protobuf:"bytes,5,opt,name=paying_reserve_address,json=payingReserveAddress,proto3" json:"paying_reserve_address,omitempty"` + // start_price specifies the starting price of the auction + // it is determined by the proportion of the price of paying coin denom + StartPrice string `protobuf:"bytes,6,opt,name=start_price,json=startPrice,proto3" json:"start_price,omitempty"` + // selling_coin specifies the selling coin for the auction + SellingCoin *v1beta1.Coin `protobuf:"bytes,7,opt,name=selling_coin,json=sellingCoin,proto3" json:"selling_coin,omitempty"` + // paying_coin_denom specifies the paying coin denom that bidders use to bid + // for + PayingCoinDenom string `protobuf:"bytes,8,opt,name=paying_coin_denom,json=payingCoinDenom,proto3" json:"paying_coin_denom,omitempty"` + // vesting_reserve_address specifies the bech32-encoded vesting address that + // holds vesting amounts of coin + VestingReserveAddress string `protobuf:"bytes,9,opt,name=vesting_reserve_address,json=vestingReserveAddress,proto3" json:"vesting_reserve_address,omitempty"` + // vesting_schedules specifies the vesting schedules for the auction + VestingSchedules []*VestingSchedule `protobuf:"bytes,10,rep,name=vesting_schedules,json=vestingSchedules,proto3" json:"vesting_schedules,omitempty"` + // start_time specifies the start time of the plan + StartTime *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + // end_times specifies the end time of the plan + EndTimes []*timestamppb.Timestamp `protobuf:"bytes,12,rep,name=end_times,json=endTimes,proto3" json:"end_times,omitempty"` + // status specifies the auction status + Status AuctionStatus `protobuf:"varint,13,opt,name=status,proto3,enum=fundraising.fundraising.v1.AuctionStatus" json:"status,omitempty"` +} + +func (x *BaseAuction) Reset() { + *x = BaseAuction{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_auction_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BaseAuction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BaseAuction) ProtoMessage() {} + +// Deprecated: Use BaseAuction.ProtoReflect.Descriptor instead. +func (*BaseAuction) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_auction_proto_rawDescGZIP(), []int{0} +} + +func (x *BaseAuction) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *BaseAuction) GetType_() AuctionType { + if x != nil { + return x.Type_ + } + return AuctionType_AUCTION_TYPE_UNSPECIFIED +} + +func (x *BaseAuction) GetAuctioneer() string { + if x != nil { + return x.Auctioneer + } + return "" +} + +func (x *BaseAuction) GetSellingReserveAddress() string { + if x != nil { + return x.SellingReserveAddress + } + return "" +} + +func (x *BaseAuction) GetPayingReserveAddress() string { + if x != nil { + return x.PayingReserveAddress + } + return "" +} + +func (x *BaseAuction) GetStartPrice() string { + if x != nil { + return x.StartPrice + } + return "" +} + +func (x *BaseAuction) GetSellingCoin() *v1beta1.Coin { + if x != nil { + return x.SellingCoin + } + return nil +} + +func (x *BaseAuction) GetPayingCoinDenom() string { + if x != nil { + return x.PayingCoinDenom + } + return "" +} + +func (x *BaseAuction) GetVestingReserveAddress() string { + if x != nil { + return x.VestingReserveAddress + } + return "" +} + +func (x *BaseAuction) GetVestingSchedules() []*VestingSchedule { + if x != nil { + return x.VestingSchedules + } + return nil +} + +func (x *BaseAuction) GetStartTime() *timestamppb.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *BaseAuction) GetEndTimes() []*timestamppb.Timestamp { + if x != nil { + return x.EndTimes + } + return nil +} + +func (x *BaseAuction) GetStatus() AuctionStatus { + if x != nil { + return x.Status + } + return AuctionStatus_AUCTION_STATUS_UNSPECIFIED +} + +// FixedPriceAuction defines the fixed price auction type. It is the most +// simpliest way to raise funds. An auctioneer sets the starting price for each +// selling amounts of coin and bidders bid to purchase based on the fixed price. +type FixedPriceAuction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BaseAuction *BaseAuction `protobuf:"bytes,1,opt,name=base_auction,json=baseAuction,proto3" json:"base_auction,omitempty"` + // remaining_coin specifies the remaining amount of selling coin to sell + RemainingSellingCoin *v1beta1.Coin `protobuf:"bytes,2,opt,name=remaining_selling_coin,json=remainingSellingCoin,proto3" json:"remaining_selling_coin,omitempty"` +} + +func (x *FixedPriceAuction) Reset() { + *x = FixedPriceAuction{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_auction_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FixedPriceAuction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FixedPriceAuction) ProtoMessage() {} + +// Deprecated: Use FixedPriceAuction.ProtoReflect.Descriptor instead. +func (*FixedPriceAuction) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_auction_proto_rawDescGZIP(), []int{1} +} + +func (x *FixedPriceAuction) GetBaseAuction() *BaseAuction { + if x != nil { + return x.BaseAuction + } + return nil +} + +func (x *FixedPriceAuction) GetRemainingSellingCoin() *v1beta1.Coin { + if x != nil { + return x.RemainingSellingCoin + } + return nil +} + +// BatchAuction defines a batch auction type. It allows bidders to participate +// in the auction by placing their limit orders with a bid price they are +// willing to bid within the auction period. They can place multiple bids with +// different bid prices and if they want to modify their existing bid, they only +// have an option to modify with a higher bid price. Under the hood, an order +// book is created to record the bids to calculate the matched bidders. +type BatchAuction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BaseAuction *BaseAuction `protobuf:"bytes,1,opt,name=base_auction,json=baseAuction,proto3" json:"base_auction,omitempty"` + // min_bid_price specifies the minibum bid price + MinBidPrice string `protobuf:"bytes,2,opt,name=min_bid_price,json=minBidPrice,proto3" json:"min_bid_price,omitempty"` + // matched_price specifies the matched price of the auction + MatchedPrice string `protobuf:"bytes,3,opt,name=matched_price,json=matchedPrice,proto3" json:"matched_price,omitempty"` + // max_extended_round specifies a maximum number of extended rounds + MaxExtendedRound uint32 `protobuf:"varint,4,opt,name=max_extended_round,json=maxExtendedRound,proto3" json:"max_extended_round,omitempty"` + // extended_round_rate specifies the rate that decides if the auction needs + // another round + ExtendedRoundRate string `protobuf:"bytes,5,opt,name=extended_round_rate,json=extendedRoundRate,proto3" json:"extended_round_rate,omitempty"` +} + +func (x *BatchAuction) Reset() { + *x = BatchAuction{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_auction_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BatchAuction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchAuction) ProtoMessage() {} + +// Deprecated: Use BatchAuction.ProtoReflect.Descriptor instead. +func (*BatchAuction) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_auction_proto_rawDescGZIP(), []int{2} +} + +func (x *BatchAuction) GetBaseAuction() *BaseAuction { + if x != nil { + return x.BaseAuction + } + return nil +} + +func (x *BatchAuction) GetMinBidPrice() string { + if x != nil { + return x.MinBidPrice + } + return "" +} + +func (x *BatchAuction) GetMatchedPrice() string { + if x != nil { + return x.MatchedPrice + } + return "" +} + +func (x *BatchAuction) GetMaxExtendedRound() uint32 { + if x != nil { + return x.MaxExtendedRound + } + return 0 +} + +func (x *BatchAuction) GetExtendedRoundRate() string { + if x != nil { + return x.ExtendedRoundRate + } + return "" +} + +// VestingSchedule defines the vesting schedule for the owner of an auction. +type VestingSchedule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // release_time specifies the time for distribution of the vesting coin + ReleaseTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=release_time,json=releaseTime,proto3" json:"release_time,omitempty"` + // weight specifies the vesting weight for the schedule + Weight string `protobuf:"bytes,2,opt,name=weight,proto3" json:"weight,omitempty"` +} + +func (x *VestingSchedule) Reset() { + *x = VestingSchedule{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_auction_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VestingSchedule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VestingSchedule) ProtoMessage() {} + +// Deprecated: Use VestingSchedule.ProtoReflect.Descriptor instead. +func (*VestingSchedule) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_auction_proto_rawDescGZIP(), []int{3} +} + +func (x *VestingSchedule) GetReleaseTime() *timestamppb.Timestamp { + if x != nil { + return x.ReleaseTime + } + return nil +} + +func (x *VestingSchedule) GetWeight() string { + if x != nil { + return x.Weight + } + return "" +} + +var File_fundraising_fundraising_v1_auction_proto protoreflect.FileDescriptor + +var file_fundraising_fundraising_v1_auction_proto_rawDesc = []byte{ + 0x0a, 0x28, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x66, 0x75, 0x6e, 0x64, + 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, + 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 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, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x67, 0x6f, 0x67, 0x6f, 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, 0xe3, 0x06, 0x0a, 0x0b, + 0x42, 0x61, 0x73, 0x65, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x66, 0x75, 0x6e, 0x64, + 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, + 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x65, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x75, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x17, 0x73, 0x65, 0x6c, 0x6c, + 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x73, 0x65, 0x6c, 0x6c, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x34, 0x0a, 0x16, 0x70, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x14, 0x70, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x52, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, + 0x70, 0x72, 0x69, 0x63, 0x65, 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, 0x0a, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x83, 0x01, 0x0a, 0x0c, 0x73, + 0x65, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 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, 0x45, 0xc8, 0xde, + 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x27, 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, 0x9a, 0xe7, 0xb0, + 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x0b, 0x73, 0x65, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x69, 0x6e, + 0x12, 0x2a, 0x0a, 0x11, 0x70, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x5f, + 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x61, 0x79, + 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x69, 0x6e, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x36, 0x0a, 0x17, + 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x76, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x5e, 0x0a, 0x11, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, + 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2b, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x10, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x12, 0x43, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x0b, 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, 0x41, 0x0a, 0x09, 0x65, 0x6e, 0x64, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 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, 0x08, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x12, 0x41, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x66, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, + 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3a, + 0x10, 0x88, 0xa0, 0x1f, 0x00, 0xca, 0xb4, 0x2d, 0x08, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x22, 0xee, 0x01, 0x0a, 0x11, 0x46, 0x69, 0x78, 0x65, 0x64, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x50, 0x0a, 0x0c, 0x62, 0x61, 0x73, 0x65, 0x5f, + 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, + 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x41, + 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0xd0, 0xde, 0x1f, 0x01, 0x52, 0x0b, 0x62, 0x61, + 0x73, 0x65, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x80, 0x01, 0x0a, 0x16, 0x72, 0x65, + 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x5f, + 0x63, 0x6f, 0x69, 0x6e, 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, 0x2f, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x27, 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, 0x52, 0x14, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, + 0x67, 0x53, 0x65, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x69, 0x6e, 0x3a, 0x04, 0x88, 0xa0, + 0x1f, 0x00, 0x22, 0xa6, 0x03, 0x0a, 0x0c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x41, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x50, 0x0a, 0x0c, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x61, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x66, 0x75, 0x6e, 0x64, + 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, + 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x41, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x04, 0xd0, 0xde, 0x1f, 0x01, 0x52, 0x0b, 0x62, 0x61, 0x73, 0x65, 0x41, 0x75, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x55, 0x0a, 0x0d, 0x6d, 0x69, 0x6e, 0x5f, 0x62, 0x69, 0x64, + 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 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, + 0x0b, 0x6d, 0x69, 0x6e, 0x42, 0x69, 0x64, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x56, 0x0a, 0x0d, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 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, 0x0c, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x50, + 0x72, 0x69, 0x63, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x10, 0x6d, 0x61, 0x78, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x52, 0x6f, 0x75, + 0x6e, 0x64, 0x12, 0x61, 0x0a, 0x13, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x72, + 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x05, 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, 0x11, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x52, 0x6f, 0x75, 0x6e, + 0x64, 0x52, 0x61, 0x74, 0x65, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0xa5, 0x01, 0x0a, 0x0f, + 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, + 0x47, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 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, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0b, 0x72, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x49, 0x0a, 0x06, 0x77, 0x65, 0x69, 0x67, + 0x68, 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, 0x77, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x2a, 0xac, 0x01, 0x0a, 0x0b, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x30, 0x0a, 0x18, 0x41, 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x1a, 0x12, 0x8a, 0x9d, 0x20, 0x0e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x4e, 0x69, 0x6c, 0x12, 0x37, 0x0a, 0x18, 0x41, 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x58, 0x45, 0x44, 0x5f, 0x50, 0x52, 0x49, 0x43, + 0x45, 0x10, 0x01, 0x1a, 0x19, 0x8a, 0x9d, 0x20, 0x15, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x54, 0x79, 0x70, 0x65, 0x46, 0x69, 0x78, 0x65, 0x64, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x2c, + 0x0a, 0x12, 0x41, 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, + 0x41, 0x54, 0x43, 0x48, 0x10, 0x02, 0x1a, 0x14, 0x8a, 0x9d, 0x20, 0x10, 0x41, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x1a, 0x04, 0x88, 0xa3, + 0x1e, 0x00, 0x2a, 0xdf, 0x02, 0x0a, 0x0d, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x34, 0x0a, 0x1a, 0x41, 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x1a, 0x14, 0x8a, 0x9d, 0x20, 0x10, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4e, 0x69, 0x6c, 0x12, 0x34, 0x0a, 0x16, 0x41, 0x55, + 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x54, 0x41, + 0x4e, 0x44, 0x42, 0x59, 0x10, 0x01, 0x1a, 0x18, 0x8a, 0x9d, 0x20, 0x14, 0x41, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x42, 0x79, + 0x12, 0x34, 0x0a, 0x16, 0x41, 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x02, 0x1a, 0x18, 0x8a, 0x9d, + 0x20, 0x14, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x16, 0x41, 0x55, 0x43, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x45, 0x53, 0x54, 0x49, 0x4e, 0x47, + 0x10, 0x03, 0x1a, 0x18, 0x8a, 0x9d, 0x20, 0x14, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x36, 0x0a, 0x17, + 0x41, 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, + 0x49, 0x4e, 0x49, 0x53, 0x48, 0x45, 0x44, 0x10, 0x04, 0x1a, 0x19, 0x8a, 0x9d, 0x20, 0x15, 0x41, + 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x46, 0x69, 0x6e, 0x69, + 0x73, 0x68, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x18, 0x41, 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, + 0x10, 0x05, 0x1a, 0x1a, 0x8a, 0x9d, 0x20, 0x16, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, 0x64, 0x1a, 0x04, + 0x88, 0xa3, 0x1e, 0x00, 0x42, 0x88, 0x02, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x66, 0x75, 0x6e, + 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, + 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x66, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, + 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x46, 0x46, 0x58, 0xaa, 0x02, 0x1a, + 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x75, 0x6e, 0x64, + 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1a, 0x46, 0x75, 0x6e, + 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, + 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, + 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x1c, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x3a, 0x3a, + 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_fundraising_fundraising_v1_auction_proto_rawDescOnce sync.Once + file_fundraising_fundraising_v1_auction_proto_rawDescData = file_fundraising_fundraising_v1_auction_proto_rawDesc +) + +func file_fundraising_fundraising_v1_auction_proto_rawDescGZIP() []byte { + file_fundraising_fundraising_v1_auction_proto_rawDescOnce.Do(func() { + file_fundraising_fundraising_v1_auction_proto_rawDescData = protoimpl.X.CompressGZIP(file_fundraising_fundraising_v1_auction_proto_rawDescData) + }) + return file_fundraising_fundraising_v1_auction_proto_rawDescData +} + +var ( + file_fundraising_fundraising_v1_auction_proto_enumTypes = make([]protoimpl.EnumInfo, 2) + file_fundraising_fundraising_v1_auction_proto_msgTypes = make([]protoimpl.MessageInfo, 4) + file_fundraising_fundraising_v1_auction_proto_goTypes = []interface{}{ + (AuctionType)(0), // 0: fundraising.fundraising.v1.AuctionType + (AuctionStatus)(0), // 1: fundraising.fundraising.v1.AuctionStatus + (*BaseAuction)(nil), // 2: fundraising.fundraising.v1.BaseAuction + (*FixedPriceAuction)(nil), // 3: fundraising.fundraising.v1.FixedPriceAuction + (*BatchAuction)(nil), // 4: fundraising.fundraising.v1.BatchAuction + (*VestingSchedule)(nil), // 5: fundraising.fundraising.v1.VestingSchedule + (*v1beta1.Coin)(nil), // 6: cosmos.base.v1beta1.Coin + (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp + } +) + +var file_fundraising_fundraising_v1_auction_proto_depIdxs = []int32{ + 0, // 0: fundraising.fundraising.v1.BaseAuction.type:type_name -> fundraising.fundraising.v1.AuctionType + 6, // 1: fundraising.fundraising.v1.BaseAuction.selling_coin:type_name -> cosmos.base.v1beta1.Coin + 5, // 2: fundraising.fundraising.v1.BaseAuction.vesting_schedules:type_name -> fundraising.fundraising.v1.VestingSchedule + 7, // 3: fundraising.fundraising.v1.BaseAuction.start_time:type_name -> google.protobuf.Timestamp + 7, // 4: fundraising.fundraising.v1.BaseAuction.end_times:type_name -> google.protobuf.Timestamp + 1, // 5: fundraising.fundraising.v1.BaseAuction.status:type_name -> fundraising.fundraising.v1.AuctionStatus + 2, // 6: fundraising.fundraising.v1.FixedPriceAuction.base_auction:type_name -> fundraising.fundraising.v1.BaseAuction + 6, // 7: fundraising.fundraising.v1.FixedPriceAuction.remaining_selling_coin:type_name -> cosmos.base.v1beta1.Coin + 2, // 8: fundraising.fundraising.v1.BatchAuction.base_auction:type_name -> fundraising.fundraising.v1.BaseAuction + 7, // 9: fundraising.fundraising.v1.VestingSchedule.release_time:type_name -> google.protobuf.Timestamp + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_fundraising_fundraising_v1_auction_proto_init() } +func file_fundraising_fundraising_v1_auction_proto_init() { + if File_fundraising_fundraising_v1_auction_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_fundraising_fundraising_v1_auction_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BaseAuction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_auction_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FixedPriceAuction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_auction_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchAuction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_auction_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VestingSchedule); 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_fundraising_fundraising_v1_auction_proto_rawDesc, + NumEnums: 2, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_fundraising_fundraising_v1_auction_proto_goTypes, + DependencyIndexes: file_fundraising_fundraising_v1_auction_proto_depIdxs, + EnumInfos: file_fundraising_fundraising_v1_auction_proto_enumTypes, + MessageInfos: file_fundraising_fundraising_v1_auction_proto_msgTypes, + }.Build() + File_fundraising_fundraising_v1_auction_proto = out.File + file_fundraising_fundraising_v1_auction_proto_rawDesc = nil + file_fundraising_fundraising_v1_auction_proto_goTypes = nil + file_fundraising_fundraising_v1_auction_proto_depIdxs = nil +} diff --git a/api/fundraising/fundraising/v1/bid.pulsar.go b/api/fundraising/fundraising/v1/bid.pulsar.go new file mode 100644 index 00000000..60ee4946 --- /dev/null +++ b/api/fundraising/fundraising/v1/bid.pulsar.go @@ -0,0 +1,1149 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package fundraisingv1 + +import ( + fmt "fmt" + io "io" + reflect "reflect" + sync "sync" + + _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +var ( + md_Bid protoreflect.MessageDescriptor + fd_Bid_auction_id protoreflect.FieldDescriptor + fd_Bid_bidder protoreflect.FieldDescriptor + fd_Bid_id protoreflect.FieldDescriptor + fd_Bid_type protoreflect.FieldDescriptor + fd_Bid_price protoreflect.FieldDescriptor + fd_Bid_coin protoreflect.FieldDescriptor + fd_Bid_is_matched protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_bid_proto_init() + md_Bid = File_fundraising_fundraising_v1_bid_proto.Messages().ByName("Bid") + fd_Bid_auction_id = md_Bid.Fields().ByName("auction_id") + fd_Bid_bidder = md_Bid.Fields().ByName("bidder") + fd_Bid_id = md_Bid.Fields().ByName("id") + fd_Bid_type = md_Bid.Fields().ByName("type") + fd_Bid_price = md_Bid.Fields().ByName("price") + fd_Bid_coin = md_Bid.Fields().ByName("coin") + fd_Bid_is_matched = md_Bid.Fields().ByName("is_matched") +} + +var _ protoreflect.Message = (*fastReflection_Bid)(nil) + +type fastReflection_Bid Bid + +func (x *Bid) ProtoReflect() protoreflect.Message { + return (*fastReflection_Bid)(x) +} + +func (x *Bid) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_bid_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_Bid_messageType fastReflection_Bid_messageType + _ protoreflect.MessageType = fastReflection_Bid_messageType{} +) + +type fastReflection_Bid_messageType struct{} + +func (x fastReflection_Bid_messageType) Zero() protoreflect.Message { + return (*fastReflection_Bid)(nil) +} + +func (x fastReflection_Bid_messageType) New() protoreflect.Message { + return new(fastReflection_Bid) +} + +func (x fastReflection_Bid_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Bid +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Bid) Descriptor() protoreflect.MessageDescriptor { + return md_Bid +} + +// 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_Bid) Type() protoreflect.MessageType { + return _fastReflection_Bid_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Bid) New() protoreflect.Message { + return new(fastReflection_Bid) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Bid) Interface() protoreflect.ProtoMessage { + return (*Bid)(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_Bid) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AuctionId != uint64(0) { + value := protoreflect.ValueOfUint64(x.AuctionId) + if !f(fd_Bid_auction_id, value) { + return + } + } + if x.Bidder != "" { + value := protoreflect.ValueOfString(x.Bidder) + if !f(fd_Bid_bidder, value) { + return + } + } + if x.Id != uint64(0) { + value := protoreflect.ValueOfUint64(x.Id) + if !f(fd_Bid_id, value) { + return + } + } + if x.Type_ != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Type_)) + if !f(fd_Bid_type, value) { + return + } + } + if x.Price != "" { + value := protoreflect.ValueOfString(x.Price) + if !f(fd_Bid_price, value) { + return + } + } + if x.Coin != nil { + value := protoreflect.ValueOfMessage(x.Coin.ProtoReflect()) + if !f(fd_Bid_coin, value) { + return + } + } + if x.IsMatched != false { + value := protoreflect.ValueOfBool(x.IsMatched) + if !f(fd_Bid_is_matched, 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_Bid) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.Bid.auction_id": + return x.AuctionId != uint64(0) + case "fundraising.fundraising.v1.Bid.bidder": + return x.Bidder != "" + case "fundraising.fundraising.v1.Bid.id": + return x.Id != uint64(0) + case "fundraising.fundraising.v1.Bid.type": + return x.Type_ != 0 + case "fundraising.fundraising.v1.Bid.price": + return x.Price != "" + case "fundraising.fundraising.v1.Bid.coin": + return x.Coin != nil + case "fundraising.fundraising.v1.Bid.is_matched": + return x.IsMatched != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.Bid")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.Bid 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_Bid) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.Bid.auction_id": + x.AuctionId = uint64(0) + case "fundraising.fundraising.v1.Bid.bidder": + x.Bidder = "" + case "fundraising.fundraising.v1.Bid.id": + x.Id = uint64(0) + case "fundraising.fundraising.v1.Bid.type": + x.Type_ = 0 + case "fundraising.fundraising.v1.Bid.price": + x.Price = "" + case "fundraising.fundraising.v1.Bid.coin": + x.Coin = nil + case "fundraising.fundraising.v1.Bid.is_matched": + x.IsMatched = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.Bid")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.Bid 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_Bid) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.Bid.auction_id": + value := x.AuctionId + return protoreflect.ValueOfUint64(value) + case "fundraising.fundraising.v1.Bid.bidder": + value := x.Bidder + return protoreflect.ValueOfString(value) + case "fundraising.fundraising.v1.Bid.id": + value := x.Id + return protoreflect.ValueOfUint64(value) + case "fundraising.fundraising.v1.Bid.type": + value := x.Type_ + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "fundraising.fundraising.v1.Bid.price": + value := x.Price + return protoreflect.ValueOfString(value) + case "fundraising.fundraising.v1.Bid.coin": + value := x.Coin + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "fundraising.fundraising.v1.Bid.is_matched": + value := x.IsMatched + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.Bid")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.Bid 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_Bid) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.Bid.auction_id": + x.AuctionId = value.Uint() + case "fundraising.fundraising.v1.Bid.bidder": + x.Bidder = value.Interface().(string) + case "fundraising.fundraising.v1.Bid.id": + x.Id = value.Uint() + case "fundraising.fundraising.v1.Bid.type": + x.Type_ = (BidType)(value.Enum()) + case "fundraising.fundraising.v1.Bid.price": + x.Price = value.Interface().(string) + case "fundraising.fundraising.v1.Bid.coin": + x.Coin = value.Message().Interface().(*v1beta1.Coin) + case "fundraising.fundraising.v1.Bid.is_matched": + x.IsMatched = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.Bid")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.Bid 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_Bid) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.Bid.coin": + if x.Coin == nil { + x.Coin = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.Coin.ProtoReflect()) + case "fundraising.fundraising.v1.Bid.auction_id": + panic(fmt.Errorf("field auction_id of message fundraising.fundraising.v1.Bid is not mutable")) + case "fundraising.fundraising.v1.Bid.bidder": + panic(fmt.Errorf("field bidder of message fundraising.fundraising.v1.Bid is not mutable")) + case "fundraising.fundraising.v1.Bid.id": + panic(fmt.Errorf("field id of message fundraising.fundraising.v1.Bid is not mutable")) + case "fundraising.fundraising.v1.Bid.type": + panic(fmt.Errorf("field type of message fundraising.fundraising.v1.Bid is not mutable")) + case "fundraising.fundraising.v1.Bid.price": + panic(fmt.Errorf("field price of message fundraising.fundraising.v1.Bid is not mutable")) + case "fundraising.fundraising.v1.Bid.is_matched": + panic(fmt.Errorf("field is_matched of message fundraising.fundraising.v1.Bid is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.Bid")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.Bid 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_Bid) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.Bid.auction_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "fundraising.fundraising.v1.Bid.bidder": + return protoreflect.ValueOfString("") + case "fundraising.fundraising.v1.Bid.id": + return protoreflect.ValueOfUint64(uint64(0)) + case "fundraising.fundraising.v1.Bid.type": + return protoreflect.ValueOfEnum(0) + case "fundraising.fundraising.v1.Bid.price": + return protoreflect.ValueOfString("") + case "fundraising.fundraising.v1.Bid.coin": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "fundraising.fundraising.v1.Bid.is_matched": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.Bid")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.Bid 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_Bid) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.Bid", 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_Bid) 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_Bid) 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_Bid) 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_Bid) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Bid) + 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.AuctionId != 0 { + n += 1 + runtime.Sov(uint64(x.AuctionId)) + } + l = len(x.Bidder) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Id != 0 { + n += 1 + runtime.Sov(uint64(x.Id)) + } + if x.Type_ != 0 { + n += 1 + runtime.Sov(uint64(x.Type_)) + } + l = len(x.Price) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Coin != nil { + l = options.Size(x.Coin) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.IsMatched { + 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().(*Bid) + 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.IsMatched { + i-- + if x.IsMatched { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if x.Coin != nil { + encoded, err := options.Marshal(x.Coin) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x32 + } + if len(x.Price) > 0 { + i -= len(x.Price) + copy(dAtA[i:], x.Price) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Price))) + i-- + dAtA[i] = 0x2a + } + if x.Type_ != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Type_)) + i-- + dAtA[i] = 0x20 + } + if x.Id != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) + i-- + dAtA[i] = 0x18 + } + if len(x.Bidder) > 0 { + i -= len(x.Bidder) + copy(dAtA[i:], x.Bidder) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bidder))) + i-- + dAtA[i] = 0x12 + } + if x.AuctionId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AuctionId)) + 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().(*Bid) + 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: Bid: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Bid: 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 AuctionId", wireType) + } + x.AuctionId = 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.AuctionId |= 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 Bidder", 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.Bidder = 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 Id", wireType) + } + x.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Type_", wireType) + } + x.Type_ = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Type_ |= BidType(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 Price", 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.Price = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Coin", 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.Coin == nil { + x.Coin = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Coin); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IsMatched", 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.IsMatched = 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: fundraising/fundraising/v1/bid.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) +) + +// BidType enumerates the valid types of a bid. +type BidType int32 + +const ( + // BID_TYPE_UNSPECIFIED defines the default bid type + BidType_BID_TYPE_UNSPECIFIED BidType = 0 + // BID_TYPE_FIXED_PRICE defines a bid type for a fixed price auction type + BidType_BID_TYPE_FIXED_PRICE BidType = 1 + // BID_TYPE_BATCH_WORTH defines a bid type for How-Much-Worth-to-Buy of a + // batch auction + BidType_BID_TYPE_BATCH_WORTH BidType = 2 + // BID_TYPE_BATCH_MANY defines a bid type for How-Many-Coins-to-Buy of a batch + // auction + BidType_BID_TYPE_BATCH_MANY BidType = 3 +) + +// Enum value maps for BidType. +var ( + BidType_name = map[int32]string{ + 0: "BID_TYPE_UNSPECIFIED", + 1: "BID_TYPE_FIXED_PRICE", + 2: "BID_TYPE_BATCH_WORTH", + 3: "BID_TYPE_BATCH_MANY", + } + BidType_value = map[string]int32{ + "BID_TYPE_UNSPECIFIED": 0, + "BID_TYPE_FIXED_PRICE": 1, + "BID_TYPE_BATCH_WORTH": 2, + "BID_TYPE_BATCH_MANY": 3, + } +) + +func (x BidType) Enum() *BidType { + p := new(BidType) + *p = x + return p +} + +func (x BidType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (BidType) Descriptor() protoreflect.EnumDescriptor { + return file_fundraising_fundraising_v1_bid_proto_enumTypes[0].Descriptor() +} + +func (BidType) Type() protoreflect.EnumType { + return &file_fundraising_fundraising_v1_bid_proto_enumTypes[0] +} + +func (x BidType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use BidType.Descriptor instead. +func (BidType) EnumDescriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_bid_proto_rawDescGZIP(), []int{0} +} + +// AddressType enumerates the available types of a address. +type AddressType int32 + +const ( + // the 32 bytes length address type of ADR 028. + AddressType_ADDRESS_TYPE_32_BYTES AddressType = 0 + // the default 20 bytes length address type. + AddressType_ADDRESS_TYPE_20_BYTES AddressType = 1 +) + +// Enum value maps for AddressType. +var ( + AddressType_name = map[int32]string{ + 0: "ADDRESS_TYPE_32_BYTES", + 1: "ADDRESS_TYPE_20_BYTES", + } + AddressType_value = map[string]int32{ + "ADDRESS_TYPE_32_BYTES": 0, + "ADDRESS_TYPE_20_BYTES": 1, + } +) + +func (x AddressType) Enum() *AddressType { + p := new(AddressType) + *p = x + return p +} + +func (x AddressType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AddressType) Descriptor() protoreflect.EnumDescriptor { + return file_fundraising_fundraising_v1_bid_proto_enumTypes[1].Descriptor() +} + +func (AddressType) Type() protoreflect.EnumType { + return &file_fundraising_fundraising_v1_bid_proto_enumTypes[1] +} + +func (x AddressType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AddressType.Descriptor instead. +func (AddressType) EnumDescriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_bid_proto_rawDescGZIP(), []int{1} +} + +// Bid defines a standard bid for an auction. +type Bid struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // auction_id specifies the id of the auction + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + // bidder specifies the bech32-encoded address that bids for the auction + Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` + // id specifies an index of a bid for the bidder + Id uint64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` + // type specifies the bid type; type 1 is fixed price, 2 is how-much-worth, 3 + // is how-many-coins + Type_ BidType `protobuf:"varint,4,opt,name=type,proto3,enum=fundraising.fundraising.v1.BidType" json:"type,omitempty"` + // price specifies the bid price in which price the bidder places the bid + Price string `protobuf:"bytes,5,opt,name=price,proto3" json:"price,omitempty"` + // coin specifies the amount of coin that the bidder bids + // for a fixed price auction, the denom is of the paying coin. + // for a batch auction of how-much-worth, the denom is of the paying coin. + // for a batch auction of how-many-coins, the denom is of the selling coin. + Coin *v1beta1.Coin `protobuf:"bytes,6,opt,name=coin,proto3" json:"coin,omitempty"` + // is_matched specifies the bid that is a winning bid and enables the bidder + // to purchase the selling coin + IsMatched bool `protobuf:"varint,7,opt,name=is_matched,json=isMatched,proto3" json:"is_matched,omitempty"` +} + +func (x *Bid) Reset() { + *x = Bid{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_bid_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Bid) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Bid) ProtoMessage() {} + +// Deprecated: Use Bid.ProtoReflect.Descriptor instead. +func (*Bid) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_bid_proto_rawDescGZIP(), []int{0} +} + +func (x *Bid) GetAuctionId() uint64 { + if x != nil { + return x.AuctionId + } + return 0 +} + +func (x *Bid) GetBidder() string { + if x != nil { + return x.Bidder + } + return "" +} + +func (x *Bid) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Bid) GetType_() BidType { + if x != nil { + return x.Type_ + } + return BidType_BID_TYPE_UNSPECIFIED +} + +func (x *Bid) GetPrice() string { + if x != nil { + return x.Price + } + return "" +} + +func (x *Bid) GetCoin() *v1beta1.Coin { + if x != nil { + return x.Coin + } + return nil +} + +func (x *Bid) GetIsMatched() bool { + if x != nil { + return x.IsMatched + } + return false +} + +var File_fundraising_fundraising_v1_bid_proto protoreflect.FileDescriptor + +var file_fundraising_fundraising_v1_bid_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, + 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, + 0x76, 0x31, 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, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe9, 0x02, 0x0a, 0x03, 0x42, 0x69, 0x64, 0x12, 0x1d, + 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, + 0x06, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, + 0x69, 0x64, 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x37, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, + 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, + 0x2e, 0x42, 0x69, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x47, + 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 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, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x74, 0x0a, 0x04, 0x63, 0x6f, 0x69, 0x6e, 0x18, + 0x06, 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, 0x45, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x27, 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, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, + 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x63, 0x6f, 0x69, 0x6e, 0x12, 0x1d, 0x0a, + 0x0a, 0x69, 0x73, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x09, 0x69, 0x73, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x3a, 0x04, 0x88, 0xa0, + 0x1f, 0x00, 0x2a, 0xca, 0x01, 0x0a, 0x07, 0x42, 0x69, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, + 0x0a, 0x14, 0x42, 0x49, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x1a, 0x0e, 0x8a, 0x9d, 0x20, 0x0a, 0x42, 0x69, + 0x64, 0x54, 0x79, 0x70, 0x65, 0x4e, 0x69, 0x6c, 0x12, 0x2f, 0x0a, 0x14, 0x42, 0x49, 0x44, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x58, 0x45, 0x44, 0x5f, 0x50, 0x52, 0x49, 0x43, 0x45, + 0x10, 0x01, 0x1a, 0x15, 0x8a, 0x9d, 0x20, 0x11, 0x42, 0x69, 0x64, 0x54, 0x79, 0x70, 0x65, 0x46, + 0x69, 0x78, 0x65, 0x64, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x14, 0x42, 0x49, 0x44, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x57, 0x4f, 0x52, 0x54, + 0x48, 0x10, 0x02, 0x1a, 0x15, 0x8a, 0x9d, 0x20, 0x11, 0x42, 0x69, 0x64, 0x54, 0x79, 0x70, 0x65, + 0x42, 0x61, 0x74, 0x63, 0x68, 0x57, 0x6f, 0x72, 0x74, 0x68, 0x12, 0x2d, 0x0a, 0x13, 0x42, 0x49, + 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x4d, 0x41, 0x4e, + 0x59, 0x10, 0x03, 0x1a, 0x14, 0x8a, 0x9d, 0x20, 0x10, 0x42, 0x69, 0x64, 0x54, 0x79, 0x70, 0x65, + 0x42, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x61, 0x6e, 0x79, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x2a, + 0x79, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x31, + 0x0a, 0x15, 0x41, 0x44, 0x44, 0x52, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x33, + 0x32, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x00, 0x1a, 0x16, 0x8a, 0x9d, 0x20, 0x12, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x33, 0x32, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x12, 0x31, 0x0a, 0x15, 0x41, 0x44, 0x44, 0x52, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x32, 0x30, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x01, 0x1a, 0x16, 0x8a, 0x9d, + 0x20, 0x12, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x32, 0x30, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x42, 0x84, 0x02, 0x0a, 0x1e, 0x63, + 0x6f, 0x6d, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x42, + 0x69, 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, + 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, + 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x75, 0x6e, 0x64, + 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x46, 0x46, 0x58, 0xaa, + 0x02, 0x1a, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1a, 0x46, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x46, 0x75, 0x6e, 0x64, 0x72, + 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, 0x46, 0x75, 0x6e, 0x64, + 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, + 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x1c, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, + 0x3a, 0x3a, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_fundraising_fundraising_v1_bid_proto_rawDescOnce sync.Once + file_fundraising_fundraising_v1_bid_proto_rawDescData = file_fundraising_fundraising_v1_bid_proto_rawDesc +) + +func file_fundraising_fundraising_v1_bid_proto_rawDescGZIP() []byte { + file_fundraising_fundraising_v1_bid_proto_rawDescOnce.Do(func() { + file_fundraising_fundraising_v1_bid_proto_rawDescData = protoimpl.X.CompressGZIP(file_fundraising_fundraising_v1_bid_proto_rawDescData) + }) + return file_fundraising_fundraising_v1_bid_proto_rawDescData +} + +var ( + file_fundraising_fundraising_v1_bid_proto_enumTypes = make([]protoimpl.EnumInfo, 2) + file_fundraising_fundraising_v1_bid_proto_msgTypes = make([]protoimpl.MessageInfo, 1) + file_fundraising_fundraising_v1_bid_proto_goTypes = []interface{}{ + (BidType)(0), // 0: fundraising.fundraising.v1.BidType + (AddressType)(0), // 1: fundraising.fundraising.v1.AddressType + (*Bid)(nil), // 2: fundraising.fundraising.v1.Bid + (*v1beta1.Coin)(nil), // 3: cosmos.base.v1beta1.Coin + } +) + +var file_fundraising_fundraising_v1_bid_proto_depIdxs = []int32{ + 0, // 0: fundraising.fundraising.v1.Bid.type:type_name -> fundraising.fundraising.v1.BidType + 3, // 1: fundraising.fundraising.v1.Bid.coin:type_name -> cosmos.base.v1beta1.Coin + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_fundraising_fundraising_v1_bid_proto_init() } +func file_fundraising_fundraising_v1_bid_proto_init() { + if File_fundraising_fundraising_v1_bid_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_fundraising_fundraising_v1_bid_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Bid); 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_fundraising_fundraising_v1_bid_proto_rawDesc, + NumEnums: 2, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_fundraising_fundraising_v1_bid_proto_goTypes, + DependencyIndexes: file_fundraising_fundraising_v1_bid_proto_depIdxs, + EnumInfos: file_fundraising_fundraising_v1_bid_proto_enumTypes, + MessageInfos: file_fundraising_fundraising_v1_bid_proto_msgTypes, + }.Build() + File_fundraising_fundraising_v1_bid_proto = out.File + file_fundraising_fundraising_v1_bid_proto_rawDesc = nil + file_fundraising_fundraising_v1_bid_proto_goTypes = nil + file_fundraising_fundraising_v1_bid_proto_depIdxs = nil +} diff --git a/api/fundraising/fundraising/v1/genesis.pulsar.go b/api/fundraising/fundraising/v1/genesis.pulsar.go new file mode 100644 index 00000000..c210e330 --- /dev/null +++ b/api/fundraising/fundraising/v1/genesis.pulsar.go @@ -0,0 +1,1365 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package fundraisingv1 + +import ( + fmt "fmt" + io "io" + reflect "reflect" + sync "sync" + + _ "cosmossdk.io/api/amino" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" +) + +var _ protoreflect.List = (*_GenesisState_2_list)(nil) + +type _GenesisState_2_list struct { + list *[]*anypb.Any +} + +func (x *_GenesisState_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_2_list) AppendMutable() protoreflect.Value { + v := new(anypb.Any) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_2_list) NewElement() protoreflect.Value { + v := new(anypb.Any) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_GenesisState_4_list)(nil) + +type _GenesisState_4_list struct { + list *[]*AllowedBidder +} + +func (x *_GenesisState_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*AllowedBidder) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*AllowedBidder) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_4_list) AppendMutable() protoreflect.Value { + v := new(AllowedBidder) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_4_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_4_list) NewElement() protoreflect.Value { + v := new(AllowedBidder) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_4_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_GenesisState_5_list)(nil) + +type _GenesisState_5_list struct { + list *[]*Bid +} + +func (x *_GenesisState_5_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_5_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_5_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Bid) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_5_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Bid) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_5_list) AppendMutable() protoreflect.Value { + v := new(Bid) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_5_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_5_list) NewElement() protoreflect.Value { + v := new(Bid) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_5_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_GenesisState_7_list)(nil) + +type _GenesisState_7_list struct { + list *[]*VestingQueue +} + +func (x *_GenesisState_7_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_7_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_7_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VestingQueue) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_7_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VestingQueue) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_7_list) AppendMutable() protoreflect.Value { + v := new(VestingQueue) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_7_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_7_list) NewElement() protoreflect.Value { + v := new(VestingQueue) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_7_list) IsValid() bool { + return x.list != nil +} + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor + fd_GenesisState_auctionList protoreflect.FieldDescriptor + fd_GenesisState_auctionCount protoreflect.FieldDescriptor + fd_GenesisState_allowedBidderList protoreflect.FieldDescriptor + fd_GenesisState_bidList protoreflect.FieldDescriptor + fd_GenesisState_bidCount protoreflect.FieldDescriptor + fd_GenesisState_vestingQueueList protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_genesis_proto_init() + md_GenesisState = File_fundraising_fundraising_v1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") + fd_GenesisState_auctionList = md_GenesisState.Fields().ByName("auctionList") + fd_GenesisState_auctionCount = md_GenesisState.Fields().ByName("auctionCount") + fd_GenesisState_allowedBidderList = md_GenesisState.Fields().ByName("allowedBidderList") + fd_GenesisState_bidList = md_GenesisState.Fields().ByName("bidList") + fd_GenesisState_bidCount = md_GenesisState.Fields().ByName("bidCount") + fd_GenesisState_vestingQueueList = md_GenesisState.Fields().ByName("vestingQueueList") +} + +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_fundraising_fundraising_v1_genesis_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var ( + _fastReflection_GenesisState_messageType fastReflection_GenesisState_messageType + _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} +) + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} + +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_params, value) { + return + } + } + if len(x.AuctionList) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_2_list{list: &x.AuctionList}) + if !f(fd_GenesisState_auctionList, value) { + return + } + } + if x.AuctionCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.AuctionCount) + if !f(fd_GenesisState_auctionCount, value) { + return + } + } + if len(x.AllowedBidderList) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_4_list{list: &x.AllowedBidderList}) + if !f(fd_GenesisState_allowedBidderList, value) { + return + } + } + if len(x.BidList) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_5_list{list: &x.BidList}) + if !f(fd_GenesisState_bidList, value) { + return + } + } + if x.BidCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.BidCount) + if !f(fd_GenesisState_bidCount, value) { + return + } + } + if len(x.VestingQueueList) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_7_list{list: &x.VestingQueueList}) + if !f(fd_GenesisState_vestingQueueList, 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 "fundraising.fundraising.v1.GenesisState.params": + return x.Params != nil + case "fundraising.fundraising.v1.GenesisState.auctionList": + return len(x.AuctionList) != 0 + case "fundraising.fundraising.v1.GenesisState.auctionCount": + return x.AuctionCount != uint64(0) + case "fundraising.fundraising.v1.GenesisState.allowedBidderList": + return len(x.AllowedBidderList) != 0 + case "fundraising.fundraising.v1.GenesisState.bidList": + return len(x.BidList) != 0 + case "fundraising.fundraising.v1.GenesisState.bidCount": + return x.BidCount != uint64(0) + case "fundraising.fundraising.v1.GenesisState.vestingQueueList": + return len(x.VestingQueueList) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.GenesisState")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.GenesisState.params": + x.Params = nil + case "fundraising.fundraising.v1.GenesisState.auctionList": + x.AuctionList = nil + case "fundraising.fundraising.v1.GenesisState.auctionCount": + x.AuctionCount = uint64(0) + case "fundraising.fundraising.v1.GenesisState.allowedBidderList": + x.AllowedBidderList = nil + case "fundraising.fundraising.v1.GenesisState.bidList": + x.BidList = nil + case "fundraising.fundraising.v1.GenesisState.bidCount": + x.BidCount = uint64(0) + case "fundraising.fundraising.v1.GenesisState.vestingQueueList": + x.VestingQueueList = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.GenesisState")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "fundraising.fundraising.v1.GenesisState.auctionList": + if len(x.AuctionList) == 0 { + return protoreflect.ValueOfList(&_GenesisState_2_list{}) + } + listValue := &_GenesisState_2_list{list: &x.AuctionList} + return protoreflect.ValueOfList(listValue) + case "fundraising.fundraising.v1.GenesisState.auctionCount": + value := x.AuctionCount + return protoreflect.ValueOfUint64(value) + case "fundraising.fundraising.v1.GenesisState.allowedBidderList": + if len(x.AllowedBidderList) == 0 { + return protoreflect.ValueOfList(&_GenesisState_4_list{}) + } + listValue := &_GenesisState_4_list{list: &x.AllowedBidderList} + return protoreflect.ValueOfList(listValue) + case "fundraising.fundraising.v1.GenesisState.bidList": + if len(x.BidList) == 0 { + return protoreflect.ValueOfList(&_GenesisState_5_list{}) + } + listValue := &_GenesisState_5_list{list: &x.BidList} + return protoreflect.ValueOfList(listValue) + case "fundraising.fundraising.v1.GenesisState.bidCount": + value := x.BidCount + return protoreflect.ValueOfUint64(value) + case "fundraising.fundraising.v1.GenesisState.vestingQueueList": + if len(x.VestingQueueList) == 0 { + return protoreflect.ValueOfList(&_GenesisState_7_list{}) + } + listValue := &_GenesisState_7_list{list: &x.VestingQueueList} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.GenesisState")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.GenesisState does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.GenesisState.params": + x.Params = value.Message().Interface().(*Params) + case "fundraising.fundraising.v1.GenesisState.auctionList": + lv := value.List() + clv := lv.(*_GenesisState_2_list) + x.AuctionList = *clv.list + case "fundraising.fundraising.v1.GenesisState.auctionCount": + x.AuctionCount = value.Uint() + case "fundraising.fundraising.v1.GenesisState.allowedBidderList": + lv := value.List() + clv := lv.(*_GenesisState_4_list) + x.AllowedBidderList = *clv.list + case "fundraising.fundraising.v1.GenesisState.bidList": + lv := value.List() + clv := lv.(*_GenesisState_5_list) + x.BidList = *clv.list + case "fundraising.fundraising.v1.GenesisState.bidCount": + x.BidCount = value.Uint() + case "fundraising.fundraising.v1.GenesisState.vestingQueueList": + lv := value.List() + clv := lv.(*_GenesisState_7_list) + x.VestingQueueList = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.GenesisState")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "fundraising.fundraising.v1.GenesisState.auctionList": + if x.AuctionList == nil { + x.AuctionList = []*anypb.Any{} + } + value := &_GenesisState_2_list{list: &x.AuctionList} + return protoreflect.ValueOfList(value) + case "fundraising.fundraising.v1.GenesisState.allowedBidderList": + if x.AllowedBidderList == nil { + x.AllowedBidderList = []*AllowedBidder{} + } + value := &_GenesisState_4_list{list: &x.AllowedBidderList} + return protoreflect.ValueOfList(value) + case "fundraising.fundraising.v1.GenesisState.bidList": + if x.BidList == nil { + x.BidList = []*Bid{} + } + value := &_GenesisState_5_list{list: &x.BidList} + return protoreflect.ValueOfList(value) + case "fundraising.fundraising.v1.GenesisState.vestingQueueList": + if x.VestingQueueList == nil { + x.VestingQueueList = []*VestingQueue{} + } + value := &_GenesisState_7_list{list: &x.VestingQueueList} + return protoreflect.ValueOfList(value) + case "fundraising.fundraising.v1.GenesisState.auctionCount": + panic(fmt.Errorf("field auctionCount of message fundraising.fundraising.v1.GenesisState is not mutable")) + case "fundraising.fundraising.v1.GenesisState.bidCount": + panic(fmt.Errorf("field bidCount of message fundraising.fundraising.v1.GenesisState is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.GenesisState")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "fundraising.fundraising.v1.GenesisState.auctionList": + list := []*anypb.Any{} + return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list}) + case "fundraising.fundraising.v1.GenesisState.auctionCount": + return protoreflect.ValueOfUint64(uint64(0)) + case "fundraising.fundraising.v1.GenesisState.allowedBidderList": + list := []*AllowedBidder{} + return protoreflect.ValueOfList(&_GenesisState_4_list{list: &list}) + case "fundraising.fundraising.v1.GenesisState.bidList": + list := []*Bid{} + return protoreflect.ValueOfList(&_GenesisState_5_list{list: &list}) + case "fundraising.fundraising.v1.GenesisState.bidCount": + return protoreflect.ValueOfUint64(uint64(0)) + case "fundraising.fundraising.v1.GenesisState.vestingQueueList": + list := []*VestingQueue{} + return protoreflect.ValueOfList(&_GenesisState_7_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.GenesisState")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.GenesisState", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GenesisState) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GenesisState) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.AuctionList) > 0 { + for _, e := range x.AuctionList { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.AuctionCount != 0 { + n += 1 + runtime.Sov(uint64(x.AuctionCount)) + } + if len(x.AllowedBidderList) > 0 { + for _, e := range x.AllowedBidderList { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.BidList) > 0 { + for _, e := range x.BidList { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.BidCount != 0 { + n += 1 + runtime.Sov(uint64(x.BidCount)) + } + if len(x.VestingQueueList) > 0 { + for _, e := range x.VestingQueueList { + 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.VestingQueueList) > 0 { + for iNdEx := len(x.VestingQueueList) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.VestingQueueList[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] = 0x3a + } + } + if x.BidCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BidCount)) + i-- + dAtA[i] = 0x30 + } + if len(x.BidList) > 0 { + for iNdEx := len(x.BidList) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.BidList[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x2a + } + } + if len(x.AllowedBidderList) > 0 { + for iNdEx := len(x.AllowedBidderList) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.AllowedBidderList[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] = 0x22 + } + } + if x.AuctionCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AuctionCount)) + i-- + dAtA[i] = 0x18 + } + if len(x.AuctionList) > 0 { + for iNdEx := len(x.AuctionList) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.AuctionList[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.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AuctionList", 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.AuctionList = append(x.AuctionList, &anypb.Any{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AuctionList[len(x.AuctionList)-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 AuctionCount", wireType) + } + x.AuctionCount = 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.AuctionCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AllowedBidderList", 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.AllowedBidderList = append(x.AllowedBidderList, &AllowedBidder{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AllowedBidderList[len(x.AllowedBidderList)-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 BidList", 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.BidList = append(x.BidList, &Bid{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.BidList[len(x.BidList)-1]); 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 BidCount", wireType) + } + x.BidCount = 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.BidCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VestingQueueList", 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.VestingQueueList = append(x.VestingQueueList, &VestingQueue{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VestingQueueList[len(x.VestingQueueList)-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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: fundraising/fundraising/v1/genesis.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// GenesisState defines the fundraising module's genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params defines all the parameters of the module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + // auctionList define the auction interface for genesis state; the module + // supports FixedPriceAuction or BatchAuction + AuctionList []*anypb.Any `protobuf:"bytes,2,rep,name=auctionList,proto3" json:"auctionList,omitempty"` + AuctionCount uint64 `protobuf:"varint,3,opt,name=auctionCount,proto3" json:"auctionCount,omitempty"` + // allowedBidderList define the allowed bidder records for the auction + AllowedBidderList []*AllowedBidder `protobuf:"bytes,4,rep,name=allowedBidderList,proto3" json:"allowedBidderList,omitempty"` + // bidList define the bid records used for genesis state + BidList []*Bid `protobuf:"bytes,5,rep,name=bidList,proto3" json:"bidList,omitempty"` + BidCount uint64 `protobuf:"varint,6,opt,name=bidCount,proto3" json:"bidCount,omitempty"` + // vestingQueueList define the vesting queue records used for genesis state + VestingQueueList []*VestingQueue `protobuf:"bytes,7,rep,name=vestingQueueList,proto3" json:"vestingQueueList,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +func (x *GenesisState) GetAuctionList() []*anypb.Any { + if x != nil { + return x.AuctionList + } + return nil +} + +func (x *GenesisState) GetAuctionCount() uint64 { + if x != nil { + return x.AuctionCount + } + return 0 +} + +func (x *GenesisState) GetAllowedBidderList() []*AllowedBidder { + if x != nil { + return x.AllowedBidderList + } + return nil +} + +func (x *GenesisState) GetBidList() []*Bid { + if x != nil { + return x.BidList + } + return nil +} + +func (x *GenesisState) GetBidCount() uint64 { + if x != nil { + return x.BidCount + } + return 0 +} + +func (x *GenesisState) GetVestingQueueList() []*VestingQueue { + if x != nil { + return x.VestingQueueList + } + return nil +} + +var File_fundraising_fundraising_v1_genesis_proto protoreflect.FileDescriptor + +var file_fundraising_fundraising_v1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x28, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, + 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x66, 0x75, 0x6e, 0x64, + 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, + 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 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, 0x1a, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, + 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, + 0x2f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x28, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, + 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, + 0x31, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x24, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, + 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, + 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, + 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, + 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, + 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x5f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, + 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 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, + 0xd7, 0x03, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x45, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 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, 0x44, 0x0a, 0x0b, 0x61, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 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, 0x0c, 0xca, 0xb4, 0x2d, 0x08, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x52, 0x0b, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x22, 0x0a, + 0x0c, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0c, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x5d, 0x0a, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x42, 0x69, 0x64, 0x64, + 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x66, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, + 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, + 0x64, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x11, 0x61, + 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x3f, 0x0a, 0x07, 0x62, 0x69, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, + 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x42, + 0x69, 0x64, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x62, 0x69, 0x64, 0x4c, 0x69, 0x73, + 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x69, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x5a, 0x0a, + 0x10, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x51, 0x75, 0x65, 0x75, 0x65, 0x4c, 0x69, 0x73, + 0x74, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, + 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x51, 0x75, 0x65, 0x75, + 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x10, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x51, 0x75, 0x65, 0x75, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x88, 0x02, 0x0a, 0x1e, 0x63, 0x6f, + 0x6d, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4e, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x74, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, + 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x66, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x46, + 0x46, 0x58, 0xaa, 0x02, 0x1a, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, + 0x2e, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x1a, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x46, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, 0x46, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x46, 0x75, 0x6e, 0x64, 0x72, + 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, + 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_fundraising_fundraising_v1_genesis_proto_rawDescOnce sync.Once + file_fundraising_fundraising_v1_genesis_proto_rawDescData = file_fundraising_fundraising_v1_genesis_proto_rawDesc +) + +func file_fundraising_fundraising_v1_genesis_proto_rawDescGZIP() []byte { + file_fundraising_fundraising_v1_genesis_proto_rawDescOnce.Do(func() { + file_fundraising_fundraising_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_fundraising_fundraising_v1_genesis_proto_rawDescData) + }) + return file_fundraising_fundraising_v1_genesis_proto_rawDescData +} + +var ( + file_fundraising_fundraising_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) + file_fundraising_fundraising_v1_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: fundraising.fundraising.v1.GenesisState + (*Params)(nil), // 1: fundraising.fundraising.v1.Params + (*anypb.Any)(nil), // 2: google.protobuf.Any + (*AllowedBidder)(nil), // 3: fundraising.fundraising.v1.AllowedBidder + (*Bid)(nil), // 4: fundraising.fundraising.v1.Bid + (*VestingQueue)(nil), // 5: fundraising.fundraising.v1.VestingQueue + } +) + +var file_fundraising_fundraising_v1_genesis_proto_depIdxs = []int32{ + 1, // 0: fundraising.fundraising.v1.GenesisState.params:type_name -> fundraising.fundraising.v1.Params + 2, // 1: fundraising.fundraising.v1.GenesisState.auctionList:type_name -> google.protobuf.Any + 3, // 2: fundraising.fundraising.v1.GenesisState.allowedBidderList:type_name -> fundraising.fundraising.v1.AllowedBidder + 4, // 3: fundraising.fundraising.v1.GenesisState.bidList:type_name -> fundraising.fundraising.v1.Bid + 5, // 4: fundraising.fundraising.v1.GenesisState.vestingQueueList:type_name -> fundraising.fundraising.v1.VestingQueue + 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_fundraising_fundraising_v1_genesis_proto_init() } +func file_fundraising_fundraising_v1_genesis_proto_init() { + if File_fundraising_fundraising_v1_genesis_proto != nil { + return + } + file_fundraising_fundraising_v1_allowed_bidder_proto_init() + file_fundraising_fundraising_v1_auction_proto_init() + file_fundraising_fundraising_v1_bid_proto_init() + file_fundraising_fundraising_v1_params_proto_init() + file_fundraising_fundraising_v1_vesting_queue_proto_init() + if !protoimpl.UnsafeEnabled { + file_fundraising_fundraising_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_fundraising_fundraising_v1_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_fundraising_fundraising_v1_genesis_proto_goTypes, + DependencyIndexes: file_fundraising_fundraising_v1_genesis_proto_depIdxs, + MessageInfos: file_fundraising_fundraising_v1_genesis_proto_msgTypes, + }.Build() + File_fundraising_fundraising_v1_genesis_proto = out.File + file_fundraising_fundraising_v1_genesis_proto_rawDesc = nil + file_fundraising_fundraising_v1_genesis_proto_goTypes = nil + file_fundraising_fundraising_v1_genesis_proto_depIdxs = nil +} diff --git a/api/fundraising/fundraising/v1/params.pulsar.go b/api/fundraising/fundraising/v1/params.pulsar.go new file mode 100644 index 00000000..41cd1540 --- /dev/null +++ b/api/fundraising/fundraising/v1/params.pulsar.go @@ -0,0 +1,901 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package fundraisingv1 + +import ( + fmt "fmt" + io "io" + reflect "reflect" + sync "sync" + + _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +var _ protoreflect.List = (*_Params_1_list)(nil) + +type _Params_1_list struct { + list *[]*v1beta1.Coin +} + +func (x *_Params_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Params_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Params_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_Params_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Params_1_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Params_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Params_1_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Params_1_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Params_2_list)(nil) + +type _Params_2_list struct { + list *[]*v1beta1.Coin +} + +func (x *_Params_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Params_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Params_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_Params_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Params_2_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Params_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Params_2_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Params_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Params protoreflect.MessageDescriptor + fd_Params_auction_creation_fee protoreflect.FieldDescriptor + fd_Params_place_bid_fee protoreflect.FieldDescriptor + fd_Params_extended_period protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_params_proto_init() + md_Params = File_fundraising_fundraising_v1_params_proto.Messages().ByName("Params") + fd_Params_auction_creation_fee = md_Params.Fields().ByName("auction_creation_fee") + fd_Params_place_bid_fee = md_Params.Fields().ByName("place_bid_fee") + fd_Params_extended_period = md_Params.Fields().ByName("extended_period") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_params_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var ( + _fastReflection_Params_messageType fastReflection_Params_messageType + _ protoreflect.MessageType = fastReflection_Params_messageType{} +) + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} + +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} + +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.AuctionCreationFee) != 0 { + value := protoreflect.ValueOfList(&_Params_1_list{list: &x.AuctionCreationFee}) + if !f(fd_Params_auction_creation_fee, value) { + return + } + } + if len(x.PlaceBidFee) != 0 { + value := protoreflect.ValueOfList(&_Params_2_list{list: &x.PlaceBidFee}) + if !f(fd_Params_place_bid_fee, value) { + return + } + } + if x.ExtendedPeriod != uint32(0) { + value := protoreflect.ValueOfUint32(x.ExtendedPeriod) + if !f(fd_Params_extended_period, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.Params.auction_creation_fee": + return len(x.AuctionCreationFee) != 0 + case "fundraising.fundraising.v1.Params.place_bid_fee": + return len(x.PlaceBidFee) != 0 + case "fundraising.fundraising.v1.Params.extended_period": + return x.ExtendedPeriod != uint32(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.Params")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.Params.auction_creation_fee": + x.AuctionCreationFee = nil + case "fundraising.fundraising.v1.Params.place_bid_fee": + x.PlaceBidFee = nil + case "fundraising.fundraising.v1.Params.extended_period": + x.ExtendedPeriod = uint32(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.Params")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.Params.auction_creation_fee": + if len(x.AuctionCreationFee) == 0 { + return protoreflect.ValueOfList(&_Params_1_list{}) + } + listValue := &_Params_1_list{list: &x.AuctionCreationFee} + return protoreflect.ValueOfList(listValue) + case "fundraising.fundraising.v1.Params.place_bid_fee": + if len(x.PlaceBidFee) == 0 { + return protoreflect.ValueOfList(&_Params_2_list{}) + } + listValue := &_Params_2_list{list: &x.PlaceBidFee} + return protoreflect.ValueOfList(listValue) + case "fundraising.fundraising.v1.Params.extended_period": + value := x.ExtendedPeriod + return protoreflect.ValueOfUint32(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.Params")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.Params does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.Params.auction_creation_fee": + lv := value.List() + clv := lv.(*_Params_1_list) + x.AuctionCreationFee = *clv.list + case "fundraising.fundraising.v1.Params.place_bid_fee": + lv := value.List() + clv := lv.(*_Params_2_list) + x.PlaceBidFee = *clv.list + case "fundraising.fundraising.v1.Params.extended_period": + x.ExtendedPeriod = uint32(value.Uint()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.Params")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.Params.auction_creation_fee": + if x.AuctionCreationFee == nil { + x.AuctionCreationFee = []*v1beta1.Coin{} + } + value := &_Params_1_list{list: &x.AuctionCreationFee} + return protoreflect.ValueOfList(value) + case "fundraising.fundraising.v1.Params.place_bid_fee": + if x.PlaceBidFee == nil { + x.PlaceBidFee = []*v1beta1.Coin{} + } + value := &_Params_2_list{list: &x.PlaceBidFee} + return protoreflect.ValueOfList(value) + case "fundraising.fundraising.v1.Params.extended_period": + panic(fmt.Errorf("field extended_period of message fundraising.fundraising.v1.Params is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.Params")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.Params does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.Params.auction_creation_fee": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_Params_1_list{list: &list}) + case "fundraising.fundraising.v1.Params.place_bid_fee": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_Params_2_list{list: &list}) + case "fundraising.fundraising.v1.Params.extended_period": + return protoreflect.ValueOfUint32(uint32(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.Params")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.Params does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.Params", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Params) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Params) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.AuctionCreationFee) > 0 { + for _, e := range x.AuctionCreationFee { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.PlaceBidFee) > 0 { + for _, e := range x.PlaceBidFee { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.ExtendedPeriod != 0 { + n += 1 + runtime.Sov(uint64(x.ExtendedPeriod)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.ExtendedPeriod != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ExtendedPeriod)) + i-- + dAtA[i] = 0x18 + } + if len(x.PlaceBidFee) > 0 { + for iNdEx := len(x.PlaceBidFee) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.PlaceBidFee[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.AuctionCreationFee) > 0 { + for iNdEx := len(x.AuctionCreationFee) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.AuctionCreationFee[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().(*Params) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AuctionCreationFee", 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.AuctionCreationFee = append(x.AuctionCreationFee, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AuctionCreationFee[len(x.AuctionCreationFee)-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 PlaceBidFee", 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.PlaceBidFee = append(x.PlaceBidFee, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PlaceBidFee[len(x.PlaceBidFee)-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 ExtendedPeriod", wireType) + } + x.ExtendedPeriod = 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.ExtendedPeriod |= 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: fundraising/fundraising/v1/params.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Params defines the parameters for the module. +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // auction_creation_fee specifies the fee for auction creation. + // this prevents from spamming attack and it is collected in the community + // pool + AuctionCreationFee []*v1beta1.Coin `protobuf:"bytes,1,rep,name=auction_creation_fee,json=auctionCreationFee,proto3" json:"auction_creation_fee,omitempty"` + // place_bid_fee specifies the fee for placing a bid for an auction. + // this prevents from spamming attack and it is collected in the community + // pool + PlaceBidFee []*v1beta1.Coin `protobuf:"bytes,2,rep,name=place_bid_fee,json=placeBidFee,proto3" json:"place_bid_fee,omitempty"` + // extended_period specifies the extended period that determines how long + // the extended auction round lasts + ExtendedPeriod uint32 `protobuf:"varint,3,opt,name=extended_period,json=extendedPeriod,proto3" json:"extended_period,omitempty"` +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_params_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_params_proto_rawDescGZIP(), []int{0} +} + +func (x *Params) GetAuctionCreationFee() []*v1beta1.Coin { + if x != nil { + return x.AuctionCreationFee + } + return nil +} + +func (x *Params) GetPlaceBidFee() []*v1beta1.Coin { + if x != nil { + return x.PlaceBidFee + } + return nil +} + +func (x *Params) GetExtendedPeriod() uint32 { + if x != nil { + return x.ExtendedPeriod + } + return 0 +} + +var File_fundraising_fundraising_v1_params_proto protoreflect.FileDescriptor + +var file_fundraising_fundraising_v1_params_proto_rawDesc = []byte{ + 0x0a, 0x27, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x66, 0x75, 0x6e, 0x64, 0x72, + 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, + 0x6e, 0x67, 0x2e, 0x76, 0x31, 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, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, + 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfa, 0x02, 0x0a, 0x06, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x93, 0x01, 0x0a, 0x14, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x65, 0x65, 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, 0x12, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x65, 0x65, 0x12, 0x85, 0x01, 0x0a, 0x0d, 0x70, + 0x6c, 0x61, 0x63, 0x65, 0x5f, 0x62, 0x69, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x02, 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, 0x0b, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x42, 0x69, 0x64, 0x46, + 0x65, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x70, + 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x65, 0x78, 0x74, + 0x65, 0x6e, 0x64, 0x65, 0x64, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x3a, 0x29, 0xe8, 0xa0, 0x1f, + 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x20, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, + 0x67, 0x2f, 0x78, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x87, 0x02, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x66, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, + 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, + 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, + 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x75, 0x6e, 0x64, 0x72, + 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x46, 0x46, 0x58, 0xaa, 0x02, + 0x1a, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x75, 0x6e, + 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1a, 0x46, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, 0x46, 0x75, 0x6e, 0x64, 0x72, + 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, + 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x1c, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x3a, + 0x3a, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_fundraising_fundraising_v1_params_proto_rawDescOnce sync.Once + file_fundraising_fundraising_v1_params_proto_rawDescData = file_fundraising_fundraising_v1_params_proto_rawDesc +) + +func file_fundraising_fundraising_v1_params_proto_rawDescGZIP() []byte { + file_fundraising_fundraising_v1_params_proto_rawDescOnce.Do(func() { + file_fundraising_fundraising_v1_params_proto_rawDescData = protoimpl.X.CompressGZIP(file_fundraising_fundraising_v1_params_proto_rawDescData) + }) + return file_fundraising_fundraising_v1_params_proto_rawDescData +} + +var ( + file_fundraising_fundraising_v1_params_proto_msgTypes = make([]protoimpl.MessageInfo, 1) + file_fundraising_fundraising_v1_params_proto_goTypes = []interface{}{ + (*Params)(nil), // 0: fundraising.fundraising.v1.Params + (*v1beta1.Coin)(nil), // 1: cosmos.base.v1beta1.Coin + } +) + +var file_fundraising_fundraising_v1_params_proto_depIdxs = []int32{ + 1, // 0: fundraising.fundraising.v1.Params.auction_creation_fee:type_name -> cosmos.base.v1beta1.Coin + 1, // 1: fundraising.fundraising.v1.Params.place_bid_fee:type_name -> cosmos.base.v1beta1.Coin + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_fundraising_fundraising_v1_params_proto_init() } +func file_fundraising_fundraising_v1_params_proto_init() { + if File_fundraising_fundraising_v1_params_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_fundraising_fundraising_v1_params_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_fundraising_fundraising_v1_params_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_fundraising_fundraising_v1_params_proto_goTypes, + DependencyIndexes: file_fundraising_fundraising_v1_params_proto_depIdxs, + MessageInfos: file_fundraising_fundraising_v1_params_proto_msgTypes, + }.Build() + File_fundraising_fundraising_v1_params_proto = out.File + file_fundraising_fundraising_v1_params_proto_rawDesc = nil + file_fundraising_fundraising_v1_params_proto_goTypes = nil + file_fundraising_fundraising_v1_params_proto_depIdxs = nil +} diff --git a/api/fundraising/fundraising/v1/query.pulsar.go b/api/fundraising/fundraising/v1/query.pulsar.go new file mode 100644 index 00000000..f2fed42f --- /dev/null +++ b/api/fundraising/fundraising/v1/query.pulsar.go @@ -0,0 +1,9202 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package fundraisingv1 + +import ( + fmt "fmt" + io "io" + reflect "reflect" + sync "sync" + + _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" + _ "github.com/cosmos/cosmos-proto" + 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" + anypb "google.golang.org/protobuf/types/known/anypb" +) + +var md_QueryParamsRequest protoreflect.MessageDescriptor + +func init() { + file_fundraising_fundraising_v1_query_proto_init() + md_QueryParamsRequest = File_fundraising_fundraising_v1_query_proto.Messages().ByName("QueryParamsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) + +type fastReflection_QueryParamsRequest QueryParamsRequest + +func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(x) +} + +func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var ( + _fastReflection_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType + _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} +) + +type fastReflection_QueryParamsRequest_messageType struct{} + +func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(nil) +} + +func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} + +func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryParamsRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryParamsRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.QueryParamsRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryParamsResponse protoreflect.MessageDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_query_proto_init() + md_QueryParamsResponse = File_fundraising_fundraising_v1_query_proto.Messages().ByName("QueryParamsResponse") + fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) + +type fastReflection_QueryParamsResponse QueryParamsResponse + +func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(x) +} + +func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var ( + _fastReflection_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType + _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{} +) + +type fastReflection_QueryParamsResponse_messageType struct{} + +func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(nil) +} + +func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} + +func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryParamsResponse_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryParamsResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryParamsResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.QueryParamsResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.QueryParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryAllAuctionRequest protoreflect.MessageDescriptor + fd_QueryAllAuctionRequest_status protoreflect.FieldDescriptor + fd_QueryAllAuctionRequest_type protoreflect.FieldDescriptor + fd_QueryAllAuctionRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_query_proto_init() + md_QueryAllAuctionRequest = File_fundraising_fundraising_v1_query_proto.Messages().ByName("QueryAllAuctionRequest") + fd_QueryAllAuctionRequest_status = md_QueryAllAuctionRequest.Fields().ByName("status") + fd_QueryAllAuctionRequest_type = md_QueryAllAuctionRequest.Fields().ByName("type") + fd_QueryAllAuctionRequest_pagination = md_QueryAllAuctionRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllAuctionRequest)(nil) + +type fastReflection_QueryAllAuctionRequest QueryAllAuctionRequest + +func (x *QueryAllAuctionRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllAuctionRequest)(x) +} + +func (x *QueryAllAuctionRequest) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var ( + _fastReflection_QueryAllAuctionRequest_messageType fastReflection_QueryAllAuctionRequest_messageType + _ protoreflect.MessageType = fastReflection_QueryAllAuctionRequest_messageType{} +) + +type fastReflection_QueryAllAuctionRequest_messageType struct{} + +func (x fastReflection_QueryAllAuctionRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllAuctionRequest)(nil) +} + +func (x fastReflection_QueryAllAuctionRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllAuctionRequest) +} + +func (x fastReflection_QueryAllAuctionRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllAuctionRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllAuctionRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllAuctionRequest +} + +// 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_QueryAllAuctionRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryAllAuctionRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllAuctionRequest) New() protoreflect.Message { + return new(fastReflection_QueryAllAuctionRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllAuctionRequest) Interface() protoreflect.ProtoMessage { + return (*QueryAllAuctionRequest)(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_QueryAllAuctionRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Status != "" { + value := protoreflect.ValueOfString(x.Status) + if !f(fd_QueryAllAuctionRequest_status, value) { + return + } + } + if x.Type_ != "" { + value := protoreflect.ValueOfString(x.Type_) + if !f(fd_QueryAllAuctionRequest_type, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllAuctionRequest_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_QueryAllAuctionRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAuctionRequest.status": + return x.Status != "" + case "fundraising.fundraising.v1.QueryAllAuctionRequest.type": + return x.Type_ != "" + case "fundraising.fundraising.v1.QueryAllAuctionRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAuctionRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAuctionRequest 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_QueryAllAuctionRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAuctionRequest.status": + x.Status = "" + case "fundraising.fundraising.v1.QueryAllAuctionRequest.type": + x.Type_ = "" + case "fundraising.fundraising.v1.QueryAllAuctionRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAuctionRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAuctionRequest 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_QueryAllAuctionRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.QueryAllAuctionRequest.status": + value := x.Status + return protoreflect.ValueOfString(value) + case "fundraising.fundraising.v1.QueryAllAuctionRequest.type": + value := x.Type_ + return protoreflect.ValueOfString(value) + case "fundraising.fundraising.v1.QueryAllAuctionRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAuctionRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAuctionRequest 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_QueryAllAuctionRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAuctionRequest.status": + x.Status = value.Interface().(string) + case "fundraising.fundraising.v1.QueryAllAuctionRequest.type": + x.Type_ = value.Interface().(string) + case "fundraising.fundraising.v1.QueryAllAuctionRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAuctionRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAuctionRequest 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_QueryAllAuctionRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAuctionRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + case "fundraising.fundraising.v1.QueryAllAuctionRequest.status": + panic(fmt.Errorf("field status of message fundraising.fundraising.v1.QueryAllAuctionRequest is not mutable")) + case "fundraising.fundraising.v1.QueryAllAuctionRequest.type": + panic(fmt.Errorf("field type of message fundraising.fundraising.v1.QueryAllAuctionRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAuctionRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAuctionRequest 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_QueryAllAuctionRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAuctionRequest.status": + return protoreflect.ValueOfString("") + case "fundraising.fundraising.v1.QueryAllAuctionRequest.type": + return protoreflect.ValueOfString("") + case "fundraising.fundraising.v1.QueryAllAuctionRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAuctionRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAuctionRequest 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_QueryAllAuctionRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.QueryAllAuctionRequest", 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_QueryAllAuctionRequest) 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_QueryAllAuctionRequest) 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_QueryAllAuctionRequest) 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_QueryAllAuctionRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllAuctionRequest) + 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.Status) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Type_) + 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().(*QueryAllAuctionRequest) + 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] = 0x1a + } + if len(x.Type_) > 0 { + i -= len(x.Type_) + copy(dAtA[i:], x.Type_) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Type_))) + i-- + dAtA[i] = 0x12 + } + if len(x.Status) > 0 { + i -= len(x.Status) + copy(dAtA[i:], x.Status) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Status))) + 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().(*QueryAllAuctionRequest) + 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: QueryAllAuctionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllAuctionRequest: 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 Status", 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.Status = 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 Type_", 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.Type_ = 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 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 = (*_QueryAllAuctionResponse_1_list)(nil) + +type _QueryAllAuctionResponse_1_list struct { + list *[]*anypb.Any +} + +func (x *_QueryAllAuctionResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryAllAuctionResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryAllAuctionResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + (*x.list)[i] = concreteValue +} + +func (x *_QueryAllAuctionResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryAllAuctionResponse_1_list) AppendMutable() protoreflect.Value { + v := new(anypb.Any) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllAuctionResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryAllAuctionResponse_1_list) NewElement() protoreflect.Value { + v := new(anypb.Any) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllAuctionResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryAllAuctionResponse protoreflect.MessageDescriptor + fd_QueryAllAuctionResponse_auction protoreflect.FieldDescriptor + fd_QueryAllAuctionResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_query_proto_init() + md_QueryAllAuctionResponse = File_fundraising_fundraising_v1_query_proto.Messages().ByName("QueryAllAuctionResponse") + fd_QueryAllAuctionResponse_auction = md_QueryAllAuctionResponse.Fields().ByName("auction") + fd_QueryAllAuctionResponse_pagination = md_QueryAllAuctionResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllAuctionResponse)(nil) + +type fastReflection_QueryAllAuctionResponse QueryAllAuctionResponse + +func (x *QueryAllAuctionResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllAuctionResponse)(x) +} + +func (x *QueryAllAuctionResponse) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var ( + _fastReflection_QueryAllAuctionResponse_messageType fastReflection_QueryAllAuctionResponse_messageType + _ protoreflect.MessageType = fastReflection_QueryAllAuctionResponse_messageType{} +) + +type fastReflection_QueryAllAuctionResponse_messageType struct{} + +func (x fastReflection_QueryAllAuctionResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllAuctionResponse)(nil) +} + +func (x fastReflection_QueryAllAuctionResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllAuctionResponse) +} + +func (x fastReflection_QueryAllAuctionResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllAuctionResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllAuctionResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllAuctionResponse +} + +// 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_QueryAllAuctionResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryAllAuctionResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllAuctionResponse) New() protoreflect.Message { + return new(fastReflection_QueryAllAuctionResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllAuctionResponse) Interface() protoreflect.ProtoMessage { + return (*QueryAllAuctionResponse)(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_QueryAllAuctionResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Auction) != 0 { + value := protoreflect.ValueOfList(&_QueryAllAuctionResponse_1_list{list: &x.Auction}) + if !f(fd_QueryAllAuctionResponse_auction, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllAuctionResponse_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_QueryAllAuctionResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAuctionResponse.auction": + return len(x.Auction) != 0 + case "fundraising.fundraising.v1.QueryAllAuctionResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAuctionResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAuctionResponse 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_QueryAllAuctionResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAuctionResponse.auction": + x.Auction = nil + case "fundraising.fundraising.v1.QueryAllAuctionResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAuctionResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAuctionResponse 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_QueryAllAuctionResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.QueryAllAuctionResponse.auction": + if len(x.Auction) == 0 { + return protoreflect.ValueOfList(&_QueryAllAuctionResponse_1_list{}) + } + listValue := &_QueryAllAuctionResponse_1_list{list: &x.Auction} + return protoreflect.ValueOfList(listValue) + case "fundraising.fundraising.v1.QueryAllAuctionResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAuctionResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAuctionResponse 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_QueryAllAuctionResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAuctionResponse.auction": + lv := value.List() + clv := lv.(*_QueryAllAuctionResponse_1_list) + x.Auction = *clv.list + case "fundraising.fundraising.v1.QueryAllAuctionResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAuctionResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAuctionResponse 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_QueryAllAuctionResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAuctionResponse.auction": + if x.Auction == nil { + x.Auction = []*anypb.Any{} + } + value := &_QueryAllAuctionResponse_1_list{list: &x.Auction} + return protoreflect.ValueOfList(value) + case "fundraising.fundraising.v1.QueryAllAuctionResponse.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: fundraising.fundraising.v1.QueryAllAuctionResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAuctionResponse 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_QueryAllAuctionResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAuctionResponse.auction": + list := []*anypb.Any{} + return protoreflect.ValueOfList(&_QueryAllAuctionResponse_1_list{list: &list}) + case "fundraising.fundraising.v1.QueryAllAuctionResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAuctionResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAuctionResponse 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_QueryAllAuctionResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.QueryAllAuctionResponse", 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_QueryAllAuctionResponse) 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_QueryAllAuctionResponse) 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_QueryAllAuctionResponse) 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_QueryAllAuctionResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllAuctionResponse) + 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.Auction) > 0 { + for _, e := range x.Auction { + 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().(*QueryAllAuctionResponse) + 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.Auction) > 0 { + for iNdEx := len(x.Auction) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Auction[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().(*QueryAllAuctionResponse) + 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: QueryAllAuctionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllAuctionResponse: 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 Auction", 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.Auction = append(x.Auction, &anypb.Any{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Auction[len(x.Auction)-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 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_QueryGetAuctionRequest protoreflect.MessageDescriptor + fd_QueryGetAuctionRequest_auction_id protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_query_proto_init() + md_QueryGetAuctionRequest = File_fundraising_fundraising_v1_query_proto.Messages().ByName("QueryGetAuctionRequest") + fd_QueryGetAuctionRequest_auction_id = md_QueryGetAuctionRequest.Fields().ByName("auction_id") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetAuctionRequest)(nil) + +type fastReflection_QueryGetAuctionRequest QueryGetAuctionRequest + +func (x *QueryGetAuctionRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetAuctionRequest)(x) +} + +func (x *QueryGetAuctionRequest) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var ( + _fastReflection_QueryGetAuctionRequest_messageType fastReflection_QueryGetAuctionRequest_messageType + _ protoreflect.MessageType = fastReflection_QueryGetAuctionRequest_messageType{} +) + +type fastReflection_QueryGetAuctionRequest_messageType struct{} + +func (x fastReflection_QueryGetAuctionRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetAuctionRequest)(nil) +} + +func (x fastReflection_QueryGetAuctionRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetAuctionRequest) +} + +func (x fastReflection_QueryGetAuctionRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetAuctionRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetAuctionRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetAuctionRequest +} + +// 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_QueryGetAuctionRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryGetAuctionRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetAuctionRequest) New() protoreflect.Message { + return new(fastReflection_QueryGetAuctionRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetAuctionRequest) Interface() protoreflect.ProtoMessage { + return (*QueryGetAuctionRequest)(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_QueryGetAuctionRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AuctionId != uint64(0) { + value := protoreflect.ValueOfUint64(x.AuctionId) + if !f(fd_QueryGetAuctionRequest_auction_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_QueryGetAuctionRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAuctionRequest.auction_id": + return x.AuctionId != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAuctionRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAuctionRequest 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_QueryGetAuctionRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAuctionRequest.auction_id": + x.AuctionId = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAuctionRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAuctionRequest 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_QueryGetAuctionRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.QueryGetAuctionRequest.auction_id": + value := x.AuctionId + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAuctionRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAuctionRequest 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_QueryGetAuctionRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAuctionRequest.auction_id": + x.AuctionId = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAuctionRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAuctionRequest 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_QueryGetAuctionRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAuctionRequest.auction_id": + panic(fmt.Errorf("field auction_id of message fundraising.fundraising.v1.QueryGetAuctionRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAuctionRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAuctionRequest 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_QueryGetAuctionRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAuctionRequest.auction_id": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAuctionRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAuctionRequest 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_QueryGetAuctionRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.QueryGetAuctionRequest", 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_QueryGetAuctionRequest) 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_QueryGetAuctionRequest) 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_QueryGetAuctionRequest) 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_QueryGetAuctionRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetAuctionRequest) + 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.AuctionId != 0 { + n += 1 + runtime.Sov(uint64(x.AuctionId)) + } + 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().(*QueryGetAuctionRequest) + 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.AuctionId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AuctionId)) + 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().(*QueryGetAuctionRequest) + 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: QueryGetAuctionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetAuctionRequest: 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 AuctionId", wireType) + } + x.AuctionId = 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.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryGetAuctionResponse protoreflect.MessageDescriptor + fd_QueryGetAuctionResponse_auction protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_query_proto_init() + md_QueryGetAuctionResponse = File_fundraising_fundraising_v1_query_proto.Messages().ByName("QueryGetAuctionResponse") + fd_QueryGetAuctionResponse_auction = md_QueryGetAuctionResponse.Fields().ByName("auction") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetAuctionResponse)(nil) + +type fastReflection_QueryGetAuctionResponse QueryGetAuctionResponse + +func (x *QueryGetAuctionResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetAuctionResponse)(x) +} + +func (x *QueryGetAuctionResponse) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var ( + _fastReflection_QueryGetAuctionResponse_messageType fastReflection_QueryGetAuctionResponse_messageType + _ protoreflect.MessageType = fastReflection_QueryGetAuctionResponse_messageType{} +) + +type fastReflection_QueryGetAuctionResponse_messageType struct{} + +func (x fastReflection_QueryGetAuctionResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetAuctionResponse)(nil) +} + +func (x fastReflection_QueryGetAuctionResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetAuctionResponse) +} + +func (x fastReflection_QueryGetAuctionResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetAuctionResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetAuctionResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetAuctionResponse +} + +// 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_QueryGetAuctionResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryGetAuctionResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetAuctionResponse) New() protoreflect.Message { + return new(fastReflection_QueryGetAuctionResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetAuctionResponse) Interface() protoreflect.ProtoMessage { + return (*QueryGetAuctionResponse)(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_QueryGetAuctionResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Auction != nil { + value := protoreflect.ValueOfMessage(x.Auction.ProtoReflect()) + if !f(fd_QueryGetAuctionResponse_auction, 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_QueryGetAuctionResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAuctionResponse.auction": + return x.Auction != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAuctionResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAuctionResponse 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_QueryGetAuctionResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAuctionResponse.auction": + x.Auction = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAuctionResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAuctionResponse 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_QueryGetAuctionResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.QueryGetAuctionResponse.auction": + value := x.Auction + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAuctionResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAuctionResponse 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_QueryGetAuctionResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAuctionResponse.auction": + x.Auction = value.Message().Interface().(*anypb.Any) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAuctionResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAuctionResponse 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_QueryGetAuctionResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAuctionResponse.auction": + if x.Auction == nil { + x.Auction = new(anypb.Any) + } + return protoreflect.ValueOfMessage(x.Auction.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAuctionResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAuctionResponse 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_QueryGetAuctionResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAuctionResponse.auction": + m := new(anypb.Any) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAuctionResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAuctionResponse 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_QueryGetAuctionResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.QueryGetAuctionResponse", 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_QueryGetAuctionResponse) 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_QueryGetAuctionResponse) 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_QueryGetAuctionResponse) 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_QueryGetAuctionResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetAuctionResponse) + 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.Auction != nil { + l = options.Size(x.Auction) + 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().(*QueryGetAuctionResponse) + 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.Auction != nil { + encoded, err := options.Marshal(x.Auction) + 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().(*QueryGetAuctionResponse) + 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: QueryGetAuctionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetAuctionResponse: 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 Auction", 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.Auction == nil { + x.Auction = &anypb.Any{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Auction); 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_QueryAllAllowedBidderRequest protoreflect.MessageDescriptor + fd_QueryAllAllowedBidderRequest_auction_id protoreflect.FieldDescriptor + fd_QueryAllAllowedBidderRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_query_proto_init() + md_QueryAllAllowedBidderRequest = File_fundraising_fundraising_v1_query_proto.Messages().ByName("QueryAllAllowedBidderRequest") + fd_QueryAllAllowedBidderRequest_auction_id = md_QueryAllAllowedBidderRequest.Fields().ByName("auction_id") + fd_QueryAllAllowedBidderRequest_pagination = md_QueryAllAllowedBidderRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllAllowedBidderRequest)(nil) + +type fastReflection_QueryAllAllowedBidderRequest QueryAllAllowedBidderRequest + +func (x *QueryAllAllowedBidderRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllAllowedBidderRequest)(x) +} + +func (x *QueryAllAllowedBidderRequest) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var ( + _fastReflection_QueryAllAllowedBidderRequest_messageType fastReflection_QueryAllAllowedBidderRequest_messageType + _ protoreflect.MessageType = fastReflection_QueryAllAllowedBidderRequest_messageType{} +) + +type fastReflection_QueryAllAllowedBidderRequest_messageType struct{} + +func (x fastReflection_QueryAllAllowedBidderRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllAllowedBidderRequest)(nil) +} + +func (x fastReflection_QueryAllAllowedBidderRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllAllowedBidderRequest) +} + +func (x fastReflection_QueryAllAllowedBidderRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllAllowedBidderRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllAllowedBidderRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllAllowedBidderRequest +} + +// 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_QueryAllAllowedBidderRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryAllAllowedBidderRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllAllowedBidderRequest) New() protoreflect.Message { + return new(fastReflection_QueryAllAllowedBidderRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllAllowedBidderRequest) Interface() protoreflect.ProtoMessage { + return (*QueryAllAllowedBidderRequest)(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_QueryAllAllowedBidderRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AuctionId != uint64(0) { + value := protoreflect.ValueOfUint64(x.AuctionId) + if !f(fd_QueryAllAllowedBidderRequest_auction_id, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllAllowedBidderRequest_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_QueryAllAllowedBidderRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAllowedBidderRequest.auction_id": + return x.AuctionId != uint64(0) + case "fundraising.fundraising.v1.QueryAllAllowedBidderRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAllowedBidderRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAllowedBidderRequest 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_QueryAllAllowedBidderRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAllowedBidderRequest.auction_id": + x.AuctionId = uint64(0) + case "fundraising.fundraising.v1.QueryAllAllowedBidderRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAllowedBidderRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAllowedBidderRequest 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_QueryAllAllowedBidderRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.QueryAllAllowedBidderRequest.auction_id": + value := x.AuctionId + return protoreflect.ValueOfUint64(value) + case "fundraising.fundraising.v1.QueryAllAllowedBidderRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAllowedBidderRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAllowedBidderRequest 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_QueryAllAllowedBidderRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAllowedBidderRequest.auction_id": + x.AuctionId = value.Uint() + case "fundraising.fundraising.v1.QueryAllAllowedBidderRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAllowedBidderRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAllowedBidderRequest 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_QueryAllAllowedBidderRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAllowedBidderRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + case "fundraising.fundraising.v1.QueryAllAllowedBidderRequest.auction_id": + panic(fmt.Errorf("field auction_id of message fundraising.fundraising.v1.QueryAllAllowedBidderRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAllowedBidderRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAllowedBidderRequest 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_QueryAllAllowedBidderRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAllowedBidderRequest.auction_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "fundraising.fundraising.v1.QueryAllAllowedBidderRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAllowedBidderRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAllowedBidderRequest 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_QueryAllAllowedBidderRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.QueryAllAllowedBidderRequest", 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_QueryAllAllowedBidderRequest) 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_QueryAllAllowedBidderRequest) 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_QueryAllAllowedBidderRequest) 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_QueryAllAllowedBidderRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllAllowedBidderRequest) + 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.AuctionId != 0 { + n += 1 + runtime.Sov(uint64(x.AuctionId)) + } + 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().(*QueryAllAllowedBidderRequest) + 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 x.AuctionId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AuctionId)) + 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().(*QueryAllAllowedBidderRequest) + 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: QueryAllAllowedBidderRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllAllowedBidderRequest: 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 AuctionId", wireType) + } + x.AuctionId = 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.AuctionId |= 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 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 = (*_QueryAllAllowedBidderResponse_1_list)(nil) + +type _QueryAllAllowedBidderResponse_1_list struct { + list *[]*AllowedBidder +} + +func (x *_QueryAllAllowedBidderResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryAllAllowedBidderResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryAllAllowedBidderResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*AllowedBidder) + (*x.list)[i] = concreteValue +} + +func (x *_QueryAllAllowedBidderResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*AllowedBidder) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryAllAllowedBidderResponse_1_list) AppendMutable() protoreflect.Value { + v := new(AllowedBidder) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllAllowedBidderResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryAllAllowedBidderResponse_1_list) NewElement() protoreflect.Value { + v := new(AllowedBidder) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllAllowedBidderResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryAllAllowedBidderResponse protoreflect.MessageDescriptor + fd_QueryAllAllowedBidderResponse_allowed_bidder protoreflect.FieldDescriptor + fd_QueryAllAllowedBidderResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_query_proto_init() + md_QueryAllAllowedBidderResponse = File_fundraising_fundraising_v1_query_proto.Messages().ByName("QueryAllAllowedBidderResponse") + fd_QueryAllAllowedBidderResponse_allowed_bidder = md_QueryAllAllowedBidderResponse.Fields().ByName("allowed_bidder") + fd_QueryAllAllowedBidderResponse_pagination = md_QueryAllAllowedBidderResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllAllowedBidderResponse)(nil) + +type fastReflection_QueryAllAllowedBidderResponse QueryAllAllowedBidderResponse + +func (x *QueryAllAllowedBidderResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllAllowedBidderResponse)(x) +} + +func (x *QueryAllAllowedBidderResponse) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var ( + _fastReflection_QueryAllAllowedBidderResponse_messageType fastReflection_QueryAllAllowedBidderResponse_messageType + _ protoreflect.MessageType = fastReflection_QueryAllAllowedBidderResponse_messageType{} +) + +type fastReflection_QueryAllAllowedBidderResponse_messageType struct{} + +func (x fastReflection_QueryAllAllowedBidderResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllAllowedBidderResponse)(nil) +} + +func (x fastReflection_QueryAllAllowedBidderResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllAllowedBidderResponse) +} + +func (x fastReflection_QueryAllAllowedBidderResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllAllowedBidderResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllAllowedBidderResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllAllowedBidderResponse +} + +// 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_QueryAllAllowedBidderResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryAllAllowedBidderResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllAllowedBidderResponse) New() protoreflect.Message { + return new(fastReflection_QueryAllAllowedBidderResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllAllowedBidderResponse) Interface() protoreflect.ProtoMessage { + return (*QueryAllAllowedBidderResponse)(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_QueryAllAllowedBidderResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.AllowedBidder) != 0 { + value := protoreflect.ValueOfList(&_QueryAllAllowedBidderResponse_1_list{list: &x.AllowedBidder}) + if !f(fd_QueryAllAllowedBidderResponse_allowed_bidder, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllAllowedBidderResponse_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_QueryAllAllowedBidderResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAllowedBidderResponse.allowed_bidder": + return len(x.AllowedBidder) != 0 + case "fundraising.fundraising.v1.QueryAllAllowedBidderResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAllowedBidderResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAllowedBidderResponse 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_QueryAllAllowedBidderResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAllowedBidderResponse.allowed_bidder": + x.AllowedBidder = nil + case "fundraising.fundraising.v1.QueryAllAllowedBidderResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAllowedBidderResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAllowedBidderResponse 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_QueryAllAllowedBidderResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.QueryAllAllowedBidderResponse.allowed_bidder": + if len(x.AllowedBidder) == 0 { + return protoreflect.ValueOfList(&_QueryAllAllowedBidderResponse_1_list{}) + } + listValue := &_QueryAllAllowedBidderResponse_1_list{list: &x.AllowedBidder} + return protoreflect.ValueOfList(listValue) + case "fundraising.fundraising.v1.QueryAllAllowedBidderResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAllowedBidderResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAllowedBidderResponse 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_QueryAllAllowedBidderResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAllowedBidderResponse.allowed_bidder": + lv := value.List() + clv := lv.(*_QueryAllAllowedBidderResponse_1_list) + x.AllowedBidder = *clv.list + case "fundraising.fundraising.v1.QueryAllAllowedBidderResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAllowedBidderResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAllowedBidderResponse 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_QueryAllAllowedBidderResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAllowedBidderResponse.allowed_bidder": + if x.AllowedBidder == nil { + x.AllowedBidder = []*AllowedBidder{} + } + value := &_QueryAllAllowedBidderResponse_1_list{list: &x.AllowedBidder} + return protoreflect.ValueOfList(value) + case "fundraising.fundraising.v1.QueryAllAllowedBidderResponse.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: fundraising.fundraising.v1.QueryAllAllowedBidderResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAllowedBidderResponse 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_QueryAllAllowedBidderResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllAllowedBidderResponse.allowed_bidder": + list := []*AllowedBidder{} + return protoreflect.ValueOfList(&_QueryAllAllowedBidderResponse_1_list{list: &list}) + case "fundraising.fundraising.v1.QueryAllAllowedBidderResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllAllowedBidderResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllAllowedBidderResponse 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_QueryAllAllowedBidderResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.QueryAllAllowedBidderResponse", 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_QueryAllAllowedBidderResponse) 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_QueryAllAllowedBidderResponse) 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_QueryAllAllowedBidderResponse) 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_QueryAllAllowedBidderResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllAllowedBidderResponse) + 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.AllowedBidder) > 0 { + for _, e := range x.AllowedBidder { + 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().(*QueryAllAllowedBidderResponse) + 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.AllowedBidder) > 0 { + for iNdEx := len(x.AllowedBidder) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.AllowedBidder[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().(*QueryAllAllowedBidderResponse) + 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: QueryAllAllowedBidderResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllAllowedBidderResponse: 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 AllowedBidder", 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.AllowedBidder = append(x.AllowedBidder, &AllowedBidder{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AllowedBidder[len(x.AllowedBidder)-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 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_QueryGetAllowedBidderRequest protoreflect.MessageDescriptor + fd_QueryGetAllowedBidderRequest_auction_id protoreflect.FieldDescriptor + fd_QueryGetAllowedBidderRequest_bidder protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_query_proto_init() + md_QueryGetAllowedBidderRequest = File_fundraising_fundraising_v1_query_proto.Messages().ByName("QueryGetAllowedBidderRequest") + fd_QueryGetAllowedBidderRequest_auction_id = md_QueryGetAllowedBidderRequest.Fields().ByName("auction_id") + fd_QueryGetAllowedBidderRequest_bidder = md_QueryGetAllowedBidderRequest.Fields().ByName("bidder") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetAllowedBidderRequest)(nil) + +type fastReflection_QueryGetAllowedBidderRequest QueryGetAllowedBidderRequest + +func (x *QueryGetAllowedBidderRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetAllowedBidderRequest)(x) +} + +func (x *QueryGetAllowedBidderRequest) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var ( + _fastReflection_QueryGetAllowedBidderRequest_messageType fastReflection_QueryGetAllowedBidderRequest_messageType + _ protoreflect.MessageType = fastReflection_QueryGetAllowedBidderRequest_messageType{} +) + +type fastReflection_QueryGetAllowedBidderRequest_messageType struct{} + +func (x fastReflection_QueryGetAllowedBidderRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetAllowedBidderRequest)(nil) +} + +func (x fastReflection_QueryGetAllowedBidderRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetAllowedBidderRequest) +} + +func (x fastReflection_QueryGetAllowedBidderRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetAllowedBidderRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetAllowedBidderRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetAllowedBidderRequest +} + +// 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_QueryGetAllowedBidderRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryGetAllowedBidderRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetAllowedBidderRequest) New() protoreflect.Message { + return new(fastReflection_QueryGetAllowedBidderRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetAllowedBidderRequest) Interface() protoreflect.ProtoMessage { + return (*QueryGetAllowedBidderRequest)(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_QueryGetAllowedBidderRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AuctionId != uint64(0) { + value := protoreflect.ValueOfUint64(x.AuctionId) + if !f(fd_QueryGetAllowedBidderRequest_auction_id, value) { + return + } + } + if x.Bidder != "" { + value := protoreflect.ValueOfString(x.Bidder) + if !f(fd_QueryGetAllowedBidderRequest_bidder, 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_QueryGetAllowedBidderRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAllowedBidderRequest.auction_id": + return x.AuctionId != uint64(0) + case "fundraising.fundraising.v1.QueryGetAllowedBidderRequest.bidder": + return x.Bidder != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAllowedBidderRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAllowedBidderRequest 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_QueryGetAllowedBidderRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAllowedBidderRequest.auction_id": + x.AuctionId = uint64(0) + case "fundraising.fundraising.v1.QueryGetAllowedBidderRequest.bidder": + x.Bidder = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAllowedBidderRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAllowedBidderRequest 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_QueryGetAllowedBidderRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.QueryGetAllowedBidderRequest.auction_id": + value := x.AuctionId + return protoreflect.ValueOfUint64(value) + case "fundraising.fundraising.v1.QueryGetAllowedBidderRequest.bidder": + value := x.Bidder + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAllowedBidderRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAllowedBidderRequest 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_QueryGetAllowedBidderRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAllowedBidderRequest.auction_id": + x.AuctionId = value.Uint() + case "fundraising.fundraising.v1.QueryGetAllowedBidderRequest.bidder": + x.Bidder = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAllowedBidderRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAllowedBidderRequest 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_QueryGetAllowedBidderRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAllowedBidderRequest.auction_id": + panic(fmt.Errorf("field auction_id of message fundraising.fundraising.v1.QueryGetAllowedBidderRequest is not mutable")) + case "fundraising.fundraising.v1.QueryGetAllowedBidderRequest.bidder": + panic(fmt.Errorf("field bidder of message fundraising.fundraising.v1.QueryGetAllowedBidderRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAllowedBidderRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAllowedBidderRequest 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_QueryGetAllowedBidderRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAllowedBidderRequest.auction_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "fundraising.fundraising.v1.QueryGetAllowedBidderRequest.bidder": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAllowedBidderRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAllowedBidderRequest 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_QueryGetAllowedBidderRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.QueryGetAllowedBidderRequest", 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_QueryGetAllowedBidderRequest) 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_QueryGetAllowedBidderRequest) 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_QueryGetAllowedBidderRequest) 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_QueryGetAllowedBidderRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetAllowedBidderRequest) + 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.AuctionId != 0 { + n += 1 + runtime.Sov(uint64(x.AuctionId)) + } + l = len(x.Bidder) + 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().(*QueryGetAllowedBidderRequest) + 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.Bidder) > 0 { + i -= len(x.Bidder) + copy(dAtA[i:], x.Bidder) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bidder))) + i-- + dAtA[i] = 0x12 + } + if x.AuctionId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AuctionId)) + 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().(*QueryGetAllowedBidderRequest) + 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: QueryGetAllowedBidderRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetAllowedBidderRequest: 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 AuctionId", wireType) + } + x.AuctionId = 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.AuctionId |= 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 Bidder", 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.Bidder = 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_QueryGetAllowedBidderResponse protoreflect.MessageDescriptor + fd_QueryGetAllowedBidderResponse_allowed_bidder protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_query_proto_init() + md_QueryGetAllowedBidderResponse = File_fundraising_fundraising_v1_query_proto.Messages().ByName("QueryGetAllowedBidderResponse") + fd_QueryGetAllowedBidderResponse_allowed_bidder = md_QueryGetAllowedBidderResponse.Fields().ByName("allowed_bidder") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetAllowedBidderResponse)(nil) + +type fastReflection_QueryGetAllowedBidderResponse QueryGetAllowedBidderResponse + +func (x *QueryGetAllowedBidderResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetAllowedBidderResponse)(x) +} + +func (x *QueryGetAllowedBidderResponse) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var ( + _fastReflection_QueryGetAllowedBidderResponse_messageType fastReflection_QueryGetAllowedBidderResponse_messageType + _ protoreflect.MessageType = fastReflection_QueryGetAllowedBidderResponse_messageType{} +) + +type fastReflection_QueryGetAllowedBidderResponse_messageType struct{} + +func (x fastReflection_QueryGetAllowedBidderResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetAllowedBidderResponse)(nil) +} + +func (x fastReflection_QueryGetAllowedBidderResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetAllowedBidderResponse) +} + +func (x fastReflection_QueryGetAllowedBidderResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetAllowedBidderResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetAllowedBidderResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetAllowedBidderResponse +} + +// 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_QueryGetAllowedBidderResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryGetAllowedBidderResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetAllowedBidderResponse) New() protoreflect.Message { + return new(fastReflection_QueryGetAllowedBidderResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetAllowedBidderResponse) Interface() protoreflect.ProtoMessage { + return (*QueryGetAllowedBidderResponse)(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_QueryGetAllowedBidderResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AllowedBidder != nil { + value := protoreflect.ValueOfMessage(x.AllowedBidder.ProtoReflect()) + if !f(fd_QueryGetAllowedBidderResponse_allowed_bidder, 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_QueryGetAllowedBidderResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAllowedBidderResponse.allowed_bidder": + return x.AllowedBidder != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAllowedBidderResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAllowedBidderResponse 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_QueryGetAllowedBidderResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAllowedBidderResponse.allowed_bidder": + x.AllowedBidder = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAllowedBidderResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAllowedBidderResponse 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_QueryGetAllowedBidderResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.QueryGetAllowedBidderResponse.allowed_bidder": + value := x.AllowedBidder + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAllowedBidderResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAllowedBidderResponse 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_QueryGetAllowedBidderResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAllowedBidderResponse.allowed_bidder": + x.AllowedBidder = value.Message().Interface().(*AllowedBidder) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAllowedBidderResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAllowedBidderResponse 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_QueryGetAllowedBidderResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAllowedBidderResponse.allowed_bidder": + if x.AllowedBidder == nil { + x.AllowedBidder = new(AllowedBidder) + } + return protoreflect.ValueOfMessage(x.AllowedBidder.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAllowedBidderResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAllowedBidderResponse 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_QueryGetAllowedBidderResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetAllowedBidderResponse.allowed_bidder": + m := new(AllowedBidder) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetAllowedBidderResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetAllowedBidderResponse 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_QueryGetAllowedBidderResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.QueryGetAllowedBidderResponse", 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_QueryGetAllowedBidderResponse) 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_QueryGetAllowedBidderResponse) 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_QueryGetAllowedBidderResponse) 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_QueryGetAllowedBidderResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetAllowedBidderResponse) + 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.AllowedBidder != nil { + l = options.Size(x.AllowedBidder) + 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().(*QueryGetAllowedBidderResponse) + 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.AllowedBidder != nil { + encoded, err := options.Marshal(x.AllowedBidder) + 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().(*QueryGetAllowedBidderResponse) + 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: QueryGetAllowedBidderResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetAllowedBidderResponse: 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 AllowedBidder", 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.AllowedBidder == nil { + x.AllowedBidder = &AllowedBidder{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AllowedBidder); 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_QueryGetBidRequest protoreflect.MessageDescriptor + fd_QueryGetBidRequest_auction_id protoreflect.FieldDescriptor + fd_QueryGetBidRequest_bid_id protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_query_proto_init() + md_QueryGetBidRequest = File_fundraising_fundraising_v1_query_proto.Messages().ByName("QueryGetBidRequest") + fd_QueryGetBidRequest_auction_id = md_QueryGetBidRequest.Fields().ByName("auction_id") + fd_QueryGetBidRequest_bid_id = md_QueryGetBidRequest.Fields().ByName("bid_id") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetBidRequest)(nil) + +type fastReflection_QueryGetBidRequest QueryGetBidRequest + +func (x *QueryGetBidRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetBidRequest)(x) +} + +func (x *QueryGetBidRequest) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_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) +} + +var ( + _fastReflection_QueryGetBidRequest_messageType fastReflection_QueryGetBidRequest_messageType + _ protoreflect.MessageType = fastReflection_QueryGetBidRequest_messageType{} +) + +type fastReflection_QueryGetBidRequest_messageType struct{} + +func (x fastReflection_QueryGetBidRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetBidRequest)(nil) +} + +func (x fastReflection_QueryGetBidRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetBidRequest) +} + +func (x fastReflection_QueryGetBidRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetBidRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetBidRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetBidRequest +} + +// 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_QueryGetBidRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryGetBidRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetBidRequest) New() protoreflect.Message { + return new(fastReflection_QueryGetBidRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetBidRequest) Interface() protoreflect.ProtoMessage { + return (*QueryGetBidRequest)(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_QueryGetBidRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AuctionId != uint64(0) { + value := protoreflect.ValueOfUint64(x.AuctionId) + if !f(fd_QueryGetBidRequest_auction_id, value) { + return + } + } + if x.BidId != uint64(0) { + value := protoreflect.ValueOfUint64(x.BidId) + if !f(fd_QueryGetBidRequest_bid_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_QueryGetBidRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetBidRequest.auction_id": + return x.AuctionId != uint64(0) + case "fundraising.fundraising.v1.QueryGetBidRequest.bid_id": + return x.BidId != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetBidRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetBidRequest 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_QueryGetBidRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetBidRequest.auction_id": + x.AuctionId = uint64(0) + case "fundraising.fundraising.v1.QueryGetBidRequest.bid_id": + x.BidId = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetBidRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetBidRequest 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_QueryGetBidRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.QueryGetBidRequest.auction_id": + value := x.AuctionId + return protoreflect.ValueOfUint64(value) + case "fundraising.fundraising.v1.QueryGetBidRequest.bid_id": + value := x.BidId + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetBidRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetBidRequest 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_QueryGetBidRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetBidRequest.auction_id": + x.AuctionId = value.Uint() + case "fundraising.fundraising.v1.QueryGetBidRequest.bid_id": + x.BidId = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetBidRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetBidRequest 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_QueryGetBidRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetBidRequest.auction_id": + panic(fmt.Errorf("field auction_id of message fundraising.fundraising.v1.QueryGetBidRequest is not mutable")) + case "fundraising.fundraising.v1.QueryGetBidRequest.bid_id": + panic(fmt.Errorf("field bid_id of message fundraising.fundraising.v1.QueryGetBidRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetBidRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetBidRequest 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_QueryGetBidRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetBidRequest.auction_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "fundraising.fundraising.v1.QueryGetBidRequest.bid_id": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetBidRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetBidRequest 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_QueryGetBidRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.QueryGetBidRequest", 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_QueryGetBidRequest) 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_QueryGetBidRequest) 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_QueryGetBidRequest) 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_QueryGetBidRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetBidRequest) + 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.AuctionId != 0 { + n += 1 + runtime.Sov(uint64(x.AuctionId)) + } + if x.BidId != 0 { + n += 1 + runtime.Sov(uint64(x.BidId)) + } + 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().(*QueryGetBidRequest) + 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.BidId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BidId)) + i-- + dAtA[i] = 0x10 + } + if x.AuctionId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AuctionId)) + 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().(*QueryGetBidRequest) + 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: QueryGetBidRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetBidRequest: 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 AuctionId", wireType) + } + x.AuctionId = 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.AuctionId |= uint64(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 BidId", wireType) + } + x.BidId = 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.BidId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryGetBidResponse protoreflect.MessageDescriptor + fd_QueryGetBidResponse_bid protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_query_proto_init() + md_QueryGetBidResponse = File_fundraising_fundraising_v1_query_proto.Messages().ByName("QueryGetBidResponse") + fd_QueryGetBidResponse_bid = md_QueryGetBidResponse.Fields().ByName("bid") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetBidResponse)(nil) + +type fastReflection_QueryGetBidResponse QueryGetBidResponse + +func (x *QueryGetBidResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetBidResponse)(x) +} + +func (x *QueryGetBidResponse) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_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) +} + +var ( + _fastReflection_QueryGetBidResponse_messageType fastReflection_QueryGetBidResponse_messageType + _ protoreflect.MessageType = fastReflection_QueryGetBidResponse_messageType{} +) + +type fastReflection_QueryGetBidResponse_messageType struct{} + +func (x fastReflection_QueryGetBidResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetBidResponse)(nil) +} + +func (x fastReflection_QueryGetBidResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetBidResponse) +} + +func (x fastReflection_QueryGetBidResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetBidResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetBidResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetBidResponse +} + +// 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_QueryGetBidResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryGetBidResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetBidResponse) New() protoreflect.Message { + return new(fastReflection_QueryGetBidResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetBidResponse) Interface() protoreflect.ProtoMessage { + return (*QueryGetBidResponse)(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_QueryGetBidResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Bid != nil { + value := protoreflect.ValueOfMessage(x.Bid.ProtoReflect()) + if !f(fd_QueryGetBidResponse_bid, 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_QueryGetBidResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetBidResponse.bid": + return x.Bid != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetBidResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetBidResponse 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_QueryGetBidResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetBidResponse.bid": + x.Bid = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetBidResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetBidResponse 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_QueryGetBidResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.QueryGetBidResponse.bid": + value := x.Bid + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetBidResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetBidResponse 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_QueryGetBidResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetBidResponse.bid": + x.Bid = value.Message().Interface().(*Bid) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetBidResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetBidResponse 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_QueryGetBidResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetBidResponse.bid": + if x.Bid == nil { + x.Bid = new(Bid) + } + return protoreflect.ValueOfMessage(x.Bid.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetBidResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetBidResponse 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_QueryGetBidResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryGetBidResponse.bid": + m := new(Bid) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryGetBidResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryGetBidResponse 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_QueryGetBidResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.QueryGetBidResponse", 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_QueryGetBidResponse) 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_QueryGetBidResponse) 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_QueryGetBidResponse) 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_QueryGetBidResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetBidResponse) + 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.Bid != nil { + l = options.Size(x.Bid) + 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().(*QueryGetBidResponse) + 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.Bid != nil { + encoded, err := options.Marshal(x.Bid) + 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().(*QueryGetBidResponse) + 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: QueryGetBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetBidResponse: 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 Bid", 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.Bid == nil { + x.Bid = &Bid{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Bid); 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_QueryAllBidRequest protoreflect.MessageDescriptor + fd_QueryAllBidRequest_auction_id protoreflect.FieldDescriptor + fd_QueryAllBidRequest_bidder protoreflect.FieldDescriptor + fd_QueryAllBidRequest_is_matched protoreflect.FieldDescriptor + fd_QueryAllBidRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_query_proto_init() + md_QueryAllBidRequest = File_fundraising_fundraising_v1_query_proto.Messages().ByName("QueryAllBidRequest") + fd_QueryAllBidRequest_auction_id = md_QueryAllBidRequest.Fields().ByName("auction_id") + fd_QueryAllBidRequest_bidder = md_QueryAllBidRequest.Fields().ByName("bidder") + fd_QueryAllBidRequest_is_matched = md_QueryAllBidRequest.Fields().ByName("is_matched") + fd_QueryAllBidRequest_pagination = md_QueryAllBidRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllBidRequest)(nil) + +type fastReflection_QueryAllBidRequest QueryAllBidRequest + +func (x *QueryAllBidRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllBidRequest)(x) +} + +func (x *QueryAllBidRequest) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_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) +} + +var ( + _fastReflection_QueryAllBidRequest_messageType fastReflection_QueryAllBidRequest_messageType + _ protoreflect.MessageType = fastReflection_QueryAllBidRequest_messageType{} +) + +type fastReflection_QueryAllBidRequest_messageType struct{} + +func (x fastReflection_QueryAllBidRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllBidRequest)(nil) +} + +func (x fastReflection_QueryAllBidRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllBidRequest) +} + +func (x fastReflection_QueryAllBidRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllBidRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllBidRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllBidRequest +} + +// 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_QueryAllBidRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryAllBidRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllBidRequest) New() protoreflect.Message { + return new(fastReflection_QueryAllBidRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllBidRequest) Interface() protoreflect.ProtoMessage { + return (*QueryAllBidRequest)(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_QueryAllBidRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AuctionId != uint64(0) { + value := protoreflect.ValueOfUint64(x.AuctionId) + if !f(fd_QueryAllBidRequest_auction_id, value) { + return + } + } + if x.Bidder != "" { + value := protoreflect.ValueOfString(x.Bidder) + if !f(fd_QueryAllBidRequest_bidder, value) { + return + } + } + if x.IsMatched != "" { + value := protoreflect.ValueOfString(x.IsMatched) + if !f(fd_QueryAllBidRequest_is_matched, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllBidRequest_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_QueryAllBidRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllBidRequest.auction_id": + return x.AuctionId != uint64(0) + case "fundraising.fundraising.v1.QueryAllBidRequest.bidder": + return x.Bidder != "" + case "fundraising.fundraising.v1.QueryAllBidRequest.is_matched": + return x.IsMatched != "" + case "fundraising.fundraising.v1.QueryAllBidRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllBidRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllBidRequest 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_QueryAllBidRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllBidRequest.auction_id": + x.AuctionId = uint64(0) + case "fundraising.fundraising.v1.QueryAllBidRequest.bidder": + x.Bidder = "" + case "fundraising.fundraising.v1.QueryAllBidRequest.is_matched": + x.IsMatched = "" + case "fundraising.fundraising.v1.QueryAllBidRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllBidRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllBidRequest 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_QueryAllBidRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.QueryAllBidRequest.auction_id": + value := x.AuctionId + return protoreflect.ValueOfUint64(value) + case "fundraising.fundraising.v1.QueryAllBidRequest.bidder": + value := x.Bidder + return protoreflect.ValueOfString(value) + case "fundraising.fundraising.v1.QueryAllBidRequest.is_matched": + value := x.IsMatched + return protoreflect.ValueOfString(value) + case "fundraising.fundraising.v1.QueryAllBidRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllBidRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllBidRequest 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_QueryAllBidRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllBidRequest.auction_id": + x.AuctionId = value.Uint() + case "fundraising.fundraising.v1.QueryAllBidRequest.bidder": + x.Bidder = value.Interface().(string) + case "fundraising.fundraising.v1.QueryAllBidRequest.is_matched": + x.IsMatched = value.Interface().(string) + case "fundraising.fundraising.v1.QueryAllBidRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllBidRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllBidRequest 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_QueryAllBidRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllBidRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + case "fundraising.fundraising.v1.QueryAllBidRequest.auction_id": + panic(fmt.Errorf("field auction_id of message fundraising.fundraising.v1.QueryAllBidRequest is not mutable")) + case "fundraising.fundraising.v1.QueryAllBidRequest.bidder": + panic(fmt.Errorf("field bidder of message fundraising.fundraising.v1.QueryAllBidRequest is not mutable")) + case "fundraising.fundraising.v1.QueryAllBidRequest.is_matched": + panic(fmt.Errorf("field is_matched of message fundraising.fundraising.v1.QueryAllBidRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllBidRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllBidRequest 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_QueryAllBidRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllBidRequest.auction_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "fundraising.fundraising.v1.QueryAllBidRequest.bidder": + return protoreflect.ValueOfString("") + case "fundraising.fundraising.v1.QueryAllBidRequest.is_matched": + return protoreflect.ValueOfString("") + case "fundraising.fundraising.v1.QueryAllBidRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllBidRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllBidRequest 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_QueryAllBidRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.QueryAllBidRequest", 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_QueryAllBidRequest) 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_QueryAllBidRequest) 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_QueryAllBidRequest) 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_QueryAllBidRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllBidRequest) + 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.AuctionId != 0 { + n += 1 + runtime.Sov(uint64(x.AuctionId)) + } + l = len(x.Bidder) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.IsMatched) + 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().(*QueryAllBidRequest) + 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] = 0x22 + } + if len(x.IsMatched) > 0 { + i -= len(x.IsMatched) + copy(dAtA[i:], x.IsMatched) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.IsMatched))) + i-- + dAtA[i] = 0x1a + } + if len(x.Bidder) > 0 { + i -= len(x.Bidder) + copy(dAtA[i:], x.Bidder) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bidder))) + i-- + dAtA[i] = 0x12 + } + if x.AuctionId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AuctionId)) + 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().(*QueryAllBidRequest) + 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: QueryAllBidRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllBidRequest: 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 AuctionId", wireType) + } + x.AuctionId = 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.AuctionId |= 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 Bidder", 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.Bidder = 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 IsMatched", 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.IsMatched = 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 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 = (*_QueryAllBidResponse_1_list)(nil) + +type _QueryAllBidResponse_1_list struct { + list *[]*Bid +} + +func (x *_QueryAllBidResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryAllBidResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryAllBidResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Bid) + (*x.list)[i] = concreteValue +} + +func (x *_QueryAllBidResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Bid) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryAllBidResponse_1_list) AppendMutable() protoreflect.Value { + v := new(Bid) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllBidResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryAllBidResponse_1_list) NewElement() protoreflect.Value { + v := new(Bid) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllBidResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryAllBidResponse protoreflect.MessageDescriptor + fd_QueryAllBidResponse_bid protoreflect.FieldDescriptor + fd_QueryAllBidResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_query_proto_init() + md_QueryAllBidResponse = File_fundraising_fundraising_v1_query_proto.Messages().ByName("QueryAllBidResponse") + fd_QueryAllBidResponse_bid = md_QueryAllBidResponse.Fields().ByName("bid") + fd_QueryAllBidResponse_pagination = md_QueryAllBidResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllBidResponse)(nil) + +type fastReflection_QueryAllBidResponse QueryAllBidResponse + +func (x *QueryAllBidResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllBidResponse)(x) +} + +func (x *QueryAllBidResponse) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_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) +} + +var ( + _fastReflection_QueryAllBidResponse_messageType fastReflection_QueryAllBidResponse_messageType + _ protoreflect.MessageType = fastReflection_QueryAllBidResponse_messageType{} +) + +type fastReflection_QueryAllBidResponse_messageType struct{} + +func (x fastReflection_QueryAllBidResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllBidResponse)(nil) +} + +func (x fastReflection_QueryAllBidResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllBidResponse) +} + +func (x fastReflection_QueryAllBidResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllBidResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllBidResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllBidResponse +} + +// 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_QueryAllBidResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryAllBidResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllBidResponse) New() protoreflect.Message { + return new(fastReflection_QueryAllBidResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllBidResponse) Interface() protoreflect.ProtoMessage { + return (*QueryAllBidResponse)(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_QueryAllBidResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Bid) != 0 { + value := protoreflect.ValueOfList(&_QueryAllBidResponse_1_list{list: &x.Bid}) + if !f(fd_QueryAllBidResponse_bid, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllBidResponse_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_QueryAllBidResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllBidResponse.bid": + return len(x.Bid) != 0 + case "fundraising.fundraising.v1.QueryAllBidResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllBidResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllBidResponse 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_QueryAllBidResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllBidResponse.bid": + x.Bid = nil + case "fundraising.fundraising.v1.QueryAllBidResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllBidResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllBidResponse 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_QueryAllBidResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.QueryAllBidResponse.bid": + if len(x.Bid) == 0 { + return protoreflect.ValueOfList(&_QueryAllBidResponse_1_list{}) + } + listValue := &_QueryAllBidResponse_1_list{list: &x.Bid} + return protoreflect.ValueOfList(listValue) + case "fundraising.fundraising.v1.QueryAllBidResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllBidResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllBidResponse 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_QueryAllBidResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllBidResponse.bid": + lv := value.List() + clv := lv.(*_QueryAllBidResponse_1_list) + x.Bid = *clv.list + case "fundraising.fundraising.v1.QueryAllBidResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllBidResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllBidResponse 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_QueryAllBidResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllBidResponse.bid": + if x.Bid == nil { + x.Bid = []*Bid{} + } + value := &_QueryAllBidResponse_1_list{list: &x.Bid} + return protoreflect.ValueOfList(value) + case "fundraising.fundraising.v1.QueryAllBidResponse.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: fundraising.fundraising.v1.QueryAllBidResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllBidResponse 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_QueryAllBidResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllBidResponse.bid": + list := []*Bid{} + return protoreflect.ValueOfList(&_QueryAllBidResponse_1_list{list: &list}) + case "fundraising.fundraising.v1.QueryAllBidResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllBidResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllBidResponse 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_QueryAllBidResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.QueryAllBidResponse", 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_QueryAllBidResponse) 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_QueryAllBidResponse) 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_QueryAllBidResponse) 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_QueryAllBidResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllBidResponse) + 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.Bid) > 0 { + for _, e := range x.Bid { + 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().(*QueryAllBidResponse) + 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.Bid) > 0 { + for iNdEx := len(x.Bid) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Bid[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().(*QueryAllBidResponse) + 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: QueryAllBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllBidResponse: 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 Bid", 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.Bid = append(x.Bid, &Bid{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Bid[len(x.Bid)-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 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_QueryAllVestingQueueRequest protoreflect.MessageDescriptor + fd_QueryAllVestingQueueRequest_auction_id protoreflect.FieldDescriptor + fd_QueryAllVestingQueueRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_query_proto_init() + md_QueryAllVestingQueueRequest = File_fundraising_fundraising_v1_query_proto.Messages().ByName("QueryAllVestingQueueRequest") + fd_QueryAllVestingQueueRequest_auction_id = md_QueryAllVestingQueueRequest.Fields().ByName("auction_id") + fd_QueryAllVestingQueueRequest_pagination = md_QueryAllVestingQueueRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllVestingQueueRequest)(nil) + +type fastReflection_QueryAllVestingQueueRequest QueryAllVestingQueueRequest + +func (x *QueryAllVestingQueueRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllVestingQueueRequest)(x) +} + +func (x *QueryAllVestingQueueRequest) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_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) +} + +var ( + _fastReflection_QueryAllVestingQueueRequest_messageType fastReflection_QueryAllVestingQueueRequest_messageType + _ protoreflect.MessageType = fastReflection_QueryAllVestingQueueRequest_messageType{} +) + +type fastReflection_QueryAllVestingQueueRequest_messageType struct{} + +func (x fastReflection_QueryAllVestingQueueRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllVestingQueueRequest)(nil) +} + +func (x fastReflection_QueryAllVestingQueueRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllVestingQueueRequest) +} + +func (x fastReflection_QueryAllVestingQueueRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllVestingQueueRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllVestingQueueRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllVestingQueueRequest +} + +// 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_QueryAllVestingQueueRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryAllVestingQueueRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllVestingQueueRequest) New() protoreflect.Message { + return new(fastReflection_QueryAllVestingQueueRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllVestingQueueRequest) Interface() protoreflect.ProtoMessage { + return (*QueryAllVestingQueueRequest)(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_QueryAllVestingQueueRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AuctionId != uint64(0) { + value := protoreflect.ValueOfUint64(x.AuctionId) + if !f(fd_QueryAllVestingQueueRequest_auction_id, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllVestingQueueRequest_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_QueryAllVestingQueueRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllVestingQueueRequest.auction_id": + return x.AuctionId != uint64(0) + case "fundraising.fundraising.v1.QueryAllVestingQueueRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllVestingQueueRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllVestingQueueRequest 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_QueryAllVestingQueueRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllVestingQueueRequest.auction_id": + x.AuctionId = uint64(0) + case "fundraising.fundraising.v1.QueryAllVestingQueueRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllVestingQueueRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllVestingQueueRequest 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_QueryAllVestingQueueRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.QueryAllVestingQueueRequest.auction_id": + value := x.AuctionId + return protoreflect.ValueOfUint64(value) + case "fundraising.fundraising.v1.QueryAllVestingQueueRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllVestingQueueRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllVestingQueueRequest 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_QueryAllVestingQueueRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllVestingQueueRequest.auction_id": + x.AuctionId = value.Uint() + case "fundraising.fundraising.v1.QueryAllVestingQueueRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllVestingQueueRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllVestingQueueRequest 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_QueryAllVestingQueueRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllVestingQueueRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + case "fundraising.fundraising.v1.QueryAllVestingQueueRequest.auction_id": + panic(fmt.Errorf("field auction_id of message fundraising.fundraising.v1.QueryAllVestingQueueRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllVestingQueueRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllVestingQueueRequest 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_QueryAllVestingQueueRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllVestingQueueRequest.auction_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "fundraising.fundraising.v1.QueryAllVestingQueueRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllVestingQueueRequest")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllVestingQueueRequest 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_QueryAllVestingQueueRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.QueryAllVestingQueueRequest", 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_QueryAllVestingQueueRequest) 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_QueryAllVestingQueueRequest) 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_QueryAllVestingQueueRequest) 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_QueryAllVestingQueueRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllVestingQueueRequest) + 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.AuctionId != 0 { + n += 1 + runtime.Sov(uint64(x.AuctionId)) + } + 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().(*QueryAllVestingQueueRequest) + 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 x.AuctionId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AuctionId)) + 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().(*QueryAllVestingQueueRequest) + 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: QueryAllVestingQueueRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllVestingQueueRequest: 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 AuctionId", wireType) + } + x.AuctionId = 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.AuctionId |= 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 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 = (*_QueryAllVestingQueueResponse_1_list)(nil) + +type _QueryAllVestingQueueResponse_1_list struct { + list *[]*VestingQueue +} + +func (x *_QueryAllVestingQueueResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryAllVestingQueueResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryAllVestingQueueResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VestingQueue) + (*x.list)[i] = concreteValue +} + +func (x *_QueryAllVestingQueueResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VestingQueue) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryAllVestingQueueResponse_1_list) AppendMutable() protoreflect.Value { + v := new(VestingQueue) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllVestingQueueResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryAllVestingQueueResponse_1_list) NewElement() protoreflect.Value { + v := new(VestingQueue) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllVestingQueueResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryAllVestingQueueResponse protoreflect.MessageDescriptor + fd_QueryAllVestingQueueResponse_vestingQueue protoreflect.FieldDescriptor + fd_QueryAllVestingQueueResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_query_proto_init() + md_QueryAllVestingQueueResponse = File_fundraising_fundraising_v1_query_proto.Messages().ByName("QueryAllVestingQueueResponse") + fd_QueryAllVestingQueueResponse_vestingQueue = md_QueryAllVestingQueueResponse.Fields().ByName("vestingQueue") + fd_QueryAllVestingQueueResponse_pagination = md_QueryAllVestingQueueResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllVestingQueueResponse)(nil) + +type fastReflection_QueryAllVestingQueueResponse QueryAllVestingQueueResponse + +func (x *QueryAllVestingQueueResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllVestingQueueResponse)(x) +} + +func (x *QueryAllVestingQueueResponse) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_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) +} + +var ( + _fastReflection_QueryAllVestingQueueResponse_messageType fastReflection_QueryAllVestingQueueResponse_messageType + _ protoreflect.MessageType = fastReflection_QueryAllVestingQueueResponse_messageType{} +) + +type fastReflection_QueryAllVestingQueueResponse_messageType struct{} + +func (x fastReflection_QueryAllVestingQueueResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllVestingQueueResponse)(nil) +} + +func (x fastReflection_QueryAllVestingQueueResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllVestingQueueResponse) +} + +func (x fastReflection_QueryAllVestingQueueResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllVestingQueueResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllVestingQueueResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllVestingQueueResponse +} + +// 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_QueryAllVestingQueueResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryAllVestingQueueResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllVestingQueueResponse) New() protoreflect.Message { + return new(fastReflection_QueryAllVestingQueueResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllVestingQueueResponse) Interface() protoreflect.ProtoMessage { + return (*QueryAllVestingQueueResponse)(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_QueryAllVestingQueueResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.VestingQueue) != 0 { + value := protoreflect.ValueOfList(&_QueryAllVestingQueueResponse_1_list{list: &x.VestingQueue}) + if !f(fd_QueryAllVestingQueueResponse_vestingQueue, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllVestingQueueResponse_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_QueryAllVestingQueueResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllVestingQueueResponse.vestingQueue": + return len(x.VestingQueue) != 0 + case "fundraising.fundraising.v1.QueryAllVestingQueueResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllVestingQueueResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllVestingQueueResponse 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_QueryAllVestingQueueResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllVestingQueueResponse.vestingQueue": + x.VestingQueue = nil + case "fundraising.fundraising.v1.QueryAllVestingQueueResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllVestingQueueResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllVestingQueueResponse 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_QueryAllVestingQueueResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.QueryAllVestingQueueResponse.vestingQueue": + if len(x.VestingQueue) == 0 { + return protoreflect.ValueOfList(&_QueryAllVestingQueueResponse_1_list{}) + } + listValue := &_QueryAllVestingQueueResponse_1_list{list: &x.VestingQueue} + return protoreflect.ValueOfList(listValue) + case "fundraising.fundraising.v1.QueryAllVestingQueueResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllVestingQueueResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllVestingQueueResponse 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_QueryAllVestingQueueResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllVestingQueueResponse.vestingQueue": + lv := value.List() + clv := lv.(*_QueryAllVestingQueueResponse_1_list) + x.VestingQueue = *clv.list + case "fundraising.fundraising.v1.QueryAllVestingQueueResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllVestingQueueResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllVestingQueueResponse 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_QueryAllVestingQueueResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllVestingQueueResponse.vestingQueue": + if x.VestingQueue == nil { + x.VestingQueue = []*VestingQueue{} + } + value := &_QueryAllVestingQueueResponse_1_list{list: &x.VestingQueue} + return protoreflect.ValueOfList(value) + case "fundraising.fundraising.v1.QueryAllVestingQueueResponse.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: fundraising.fundraising.v1.QueryAllVestingQueueResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllVestingQueueResponse 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_QueryAllVestingQueueResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.QueryAllVestingQueueResponse.vestingQueue": + list := []*VestingQueue{} + return protoreflect.ValueOfList(&_QueryAllVestingQueueResponse_1_list{list: &list}) + case "fundraising.fundraising.v1.QueryAllVestingQueueResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.QueryAllVestingQueueResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.QueryAllVestingQueueResponse 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_QueryAllVestingQueueResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.QueryAllVestingQueueResponse", 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_QueryAllVestingQueueResponse) 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_QueryAllVestingQueueResponse) 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_QueryAllVestingQueueResponse) 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_QueryAllVestingQueueResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllVestingQueueResponse) + 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.VestingQueue) > 0 { + for _, e := range x.VestingQueue { + 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().(*QueryAllVestingQueueResponse) + 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.VestingQueue) > 0 { + for iNdEx := len(x.VestingQueue) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.VestingQueue[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().(*QueryAllVestingQueueResponse) + 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: QueryAllVestingQueueResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllVestingQueueResponse: 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 VestingQueue", 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.VestingQueue = append(x.VestingQueue, &VestingQueue{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VestingQueue[len(x.VestingQueue)-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 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: fundraising/fundraising/v1/query.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryParamsRequest) Reset() { + *x = QueryParamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsRequest) ProtoMessage() {} + +// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_query_proto_rawDescGZIP(), []int{0} +} + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params holds all the parameters of this module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// QueryAllAuctionRequest is request type for the Query/Auctions RPC method. +type QueryAllAuctionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Type_ string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllAuctionRequest) Reset() { + *x = QueryAllAuctionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllAuctionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllAuctionRequest) ProtoMessage() {} + +// Deprecated: Use QueryAllAuctionRequest.ProtoReflect.Descriptor instead. +func (*QueryAllAuctionRequest) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_query_proto_rawDescGZIP(), []int{2} +} + +func (x *QueryAllAuctionRequest) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *QueryAllAuctionRequest) GetType_() string { + if x != nil { + return x.Type_ + } + return "" +} + +func (x *QueryAllAuctionRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryAllAuctionResponse is response type for the Query/Auctions RPC method. +type QueryAllAuctionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // auctions specifies the existing auctions + Auction []*anypb.Any `protobuf:"bytes,1,rep,name=auction,proto3" json:"auction,omitempty"` + // pagination defines the pagination in the response + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllAuctionResponse) Reset() { + *x = QueryAllAuctionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllAuctionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllAuctionResponse) ProtoMessage() {} + +// Deprecated: Use QueryAllAuctionResponse.ProtoReflect.Descriptor instead. +func (*QueryAllAuctionResponse) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryAllAuctionResponse) GetAuction() []*anypb.Any { + if x != nil { + return x.Auction + } + return nil +} + +func (x *QueryAllAuctionResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryGetAuctionRequest is the request type for the Query/Auction RPC method. +type QueryGetAuctionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` +} + +func (x *QueryGetAuctionRequest) Reset() { + *x = QueryGetAuctionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetAuctionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetAuctionRequest) ProtoMessage() {} + +// Deprecated: Use QueryGetAuctionRequest.ProtoReflect.Descriptor instead. +func (*QueryGetAuctionRequest) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_query_proto_rawDescGZIP(), []int{4} +} + +func (x *QueryGetAuctionRequest) GetAuctionId() uint64 { + if x != nil { + return x.AuctionId + } + return 0 +} + +// QueryGetAuctionResponse is the response type for the Query/Auction RPC method. +type QueryGetAuctionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Auction *anypb.Any `protobuf:"bytes,1,opt,name=auction,proto3" json:"auction,omitempty"` +} + +func (x *QueryGetAuctionResponse) Reset() { + *x = QueryGetAuctionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetAuctionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetAuctionResponse) ProtoMessage() {} + +// Deprecated: Use QueryGetAuctionResponse.ProtoReflect.Descriptor instead. +func (*QueryGetAuctionResponse) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_query_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryGetAuctionResponse) GetAuction() *anypb.Any { + if x != nil { + return x.Auction + } + return nil +} + +// QueryAllowedBidderRequest is the request type for the Query/AllowedBidder RPC method. +type QueryAllAllowedBidderRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + Pagination *v1beta1.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllAllowedBidderRequest) Reset() { + *x = QueryAllAllowedBidderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllAllowedBidderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllAllowedBidderRequest) ProtoMessage() {} + +// Deprecated: Use QueryAllAllowedBidderRequest.ProtoReflect.Descriptor instead. +func (*QueryAllAllowedBidderRequest) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_query_proto_rawDescGZIP(), []int{6} +} + +func (x *QueryAllAllowedBidderRequest) GetAuctionId() uint64 { + if x != nil { + return x.AuctionId + } + return 0 +} + +func (x *QueryAllAllowedBidderRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryAllowedBidderResponse is the response type for the Query/AllowedBidder RPC method. +type QueryAllAllowedBidderResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AllowedBidder []*AllowedBidder `protobuf:"bytes,1,rep,name=allowed_bidder,json=allowedBidder,proto3" json:"allowed_bidder,omitempty"` + // pagination defines the pagination in the response + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllAllowedBidderResponse) Reset() { + *x = QueryAllAllowedBidderResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllAllowedBidderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllAllowedBidderResponse) ProtoMessage() {} + +// Deprecated: Use QueryAllAllowedBidderResponse.ProtoReflect.Descriptor instead. +func (*QueryAllAllowedBidderResponse) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_query_proto_rawDescGZIP(), []int{7} +} + +func (x *QueryAllAllowedBidderResponse) GetAllowedBidder() []*AllowedBidder { + if x != nil { + return x.AllowedBidder + } + return nil +} + +func (x *QueryAllAllowedBidderResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryAllowedBidderRequest is the request type for the Query/AllowedBidder RPC +// method. +type QueryGetAllowedBidderRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` +} + +func (x *QueryGetAllowedBidderRequest) Reset() { + *x = QueryGetAllowedBidderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetAllowedBidderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetAllowedBidderRequest) ProtoMessage() {} + +// Deprecated: Use QueryGetAllowedBidderRequest.ProtoReflect.Descriptor instead. +func (*QueryGetAllowedBidderRequest) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_query_proto_rawDescGZIP(), []int{8} +} + +func (x *QueryGetAllowedBidderRequest) GetAuctionId() uint64 { + if x != nil { + return x.AuctionId + } + return 0 +} + +func (x *QueryGetAllowedBidderRequest) GetBidder() string { + if x != nil { + return x.Bidder + } + return "" +} + +// QueryAllowedBidderResponse is the response type for the Query/AllowedBidder +// RPC method. +type QueryGetAllowedBidderResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AllowedBidder *AllowedBidder `protobuf:"bytes,1,opt,name=allowed_bidder,json=allowedBidder,proto3" json:"allowed_bidder,omitempty"` +} + +func (x *QueryGetAllowedBidderResponse) Reset() { + *x = QueryGetAllowedBidderResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetAllowedBidderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetAllowedBidderResponse) ProtoMessage() {} + +// Deprecated: Use QueryGetAllowedBidderResponse.ProtoReflect.Descriptor instead. +func (*QueryGetAllowedBidderResponse) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_query_proto_rawDescGZIP(), []int{9} +} + +func (x *QueryGetAllowedBidderResponse) GetAllowedBidder() *AllowedBidder { + if x != nil { + return x.AllowedBidder + } + return nil +} + +// QueryGetBidRequest is the request type for the Query/Sequence RPC method. +type QueryGetBidRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + BidId uint64 `protobuf:"varint,2,opt,name=bid_id,json=bidId,proto3" json:"bid_id,omitempty"` +} + +func (x *QueryGetBidRequest) Reset() { + *x = QueryGetBidRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetBidRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetBidRequest) ProtoMessage() {} + +// Deprecated: Use QueryGetBidRequest.ProtoReflect.Descriptor instead. +func (*QueryGetBidRequest) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_query_proto_rawDescGZIP(), []int{10} +} + +func (x *QueryGetBidRequest) GetAuctionId() uint64 { + if x != nil { + return x.AuctionId + } + return 0 +} + +func (x *QueryGetBidRequest) GetBidId() uint64 { + if x != nil { + return x.BidId + } + return 0 +} + +// QueryGetBidResponse is response type for the Query/Sequence RPC method. +type QueryGetBidResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // bid specifies specific bid + Bid *Bid `protobuf:"bytes,1,opt,name=bid,proto3" json:"bid,omitempty"` +} + +func (x *QueryGetBidResponse) Reset() { + *x = QueryGetBidResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetBidResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetBidResponse) ProtoMessage() {} + +// Deprecated: Use QueryGetBidResponse.ProtoReflect.Descriptor instead. +func (*QueryGetBidResponse) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_query_proto_rawDescGZIP(), []int{11} +} + +func (x *QueryGetBidResponse) GetBid() *Bid { + if x != nil { + return x.Bid + } + return nil +} + +// QueryBidsRequest is request type for the Query/Bids RPC method. +type QueryAllBidRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` + IsMatched string `protobuf:"bytes,3,opt,name=is_matched,json=isMatched,proto3" json:"is_matched,omitempty"` + Pagination *v1beta1.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllBidRequest) Reset() { + *x = QueryAllBidRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllBidRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllBidRequest) ProtoMessage() {} + +// Deprecated: Use QueryAllBidRequest.ProtoReflect.Descriptor instead. +func (*QueryAllBidRequest) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_query_proto_rawDescGZIP(), []int{12} +} + +func (x *QueryAllBidRequest) GetAuctionId() uint64 { + if x != nil { + return x.AuctionId + } + return 0 +} + +func (x *QueryAllBidRequest) GetBidder() string { + if x != nil { + return x.Bidder + } + return "" +} + +func (x *QueryAllBidRequest) GetIsMatched() string { + if x != nil { + return x.IsMatched + } + return "" +} + +func (x *QueryAllBidRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryBidsResponse is response type for the Query/Bids RPC method. +type QueryAllBidResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // bids specifies the existing bids + Bid []*Bid `protobuf:"bytes,1,rep,name=bid,proto3" json:"bid,omitempty"` + // pagination defines the pagination in the response + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllBidResponse) Reset() { + *x = QueryAllBidResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllBidResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllBidResponse) ProtoMessage() {} + +// Deprecated: Use QueryAllBidResponse.ProtoReflect.Descriptor instead. +func (*QueryAllBidResponse) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_query_proto_rawDescGZIP(), []int{13} +} + +func (x *QueryAllBidResponse) GetBid() []*Bid { + if x != nil { + return x.Bid + } + return nil +} + +func (x *QueryAllBidResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryAllVestingQueueRequest is request type for the Query/Vestings RPC method. +type QueryAllVestingQueueRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + Pagination *v1beta1.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllVestingQueueRequest) Reset() { + *x = QueryAllVestingQueueRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllVestingQueueRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllVestingQueueRequest) ProtoMessage() {} + +// Deprecated: Use QueryAllVestingQueueRequest.ProtoReflect.Descriptor instead. +func (*QueryAllVestingQueueRequest) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_query_proto_rawDescGZIP(), []int{14} +} + +func (x *QueryAllVestingQueueRequest) GetAuctionId() uint64 { + if x != nil { + return x.AuctionId + } + return 0 +} + +func (x *QueryAllVestingQueueRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryAllVestingQueueResponse is response type for the Query/Vestings RPC method. +type QueryAllVestingQueueResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // vestings specifies the existing vestings + VestingQueue []*VestingQueue `protobuf:"bytes,1,rep,name=vestingQueue,proto3" json:"vestingQueue,omitempty"` + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllVestingQueueResponse) Reset() { + *x = QueryAllVestingQueueResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_query_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllVestingQueueResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllVestingQueueResponse) ProtoMessage() {} + +// Deprecated: Use QueryAllVestingQueueResponse.ProtoReflect.Descriptor instead. +func (*QueryAllVestingQueueResponse) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_query_proto_rawDescGZIP(), []int{15} +} + +func (x *QueryAllVestingQueueResponse) GetVestingQueue() []*VestingQueue { + if x != nil { + return x.VestingQueue + } + return nil +} + +func (x *QueryAllVestingQueueResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + +var File_fundraising_fundraising_v1_query_proto protoreflect.FileDescriptor + +var file_fundraising_fundraising_v1_query_proto_rawDesc = []byte{ + 0x0a, 0x26, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, + 0x67, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, + 0x6f, 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, 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, 0x2f, + 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, + 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, + 0x65, 0x64, 0x5f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x28, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, + 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24, 0x66, 0x75, 0x6e, 0x64, 0x72, + 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, + 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x27, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, + 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, + 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x71, 0x75, 0x65, + 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 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, 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, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x5c, 0x0a, + 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, + 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, + 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, 0x8c, 0x01, 0x0a, 0x16, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 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, 0x22, 0xa0, 0x01, 0x0a, 0x17, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 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, 0x42, 0x0c, 0xca, + 0xb4, 0x2d, 0x08, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x52, 0x07, 0x61, 0x75, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 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, 0x37, 0x0a, + 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x75, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x57, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, + 0x65, 0x74, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 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, 0x42, 0x0c, 0xca, 0xb4, 0x2d, 0x08, 0x41, 0x75, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x52, 0x07, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x85, 0x01, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x41, 0x6c, 0x6c, 0x6f, + 0x77, 0x65, 0x64, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 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, 0xc0, 0x01, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x41, 0x6c, 0x6c, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x42, 0x69, 0x64, 0x64, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0e, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x29, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, + 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x41, + 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x42, 0x69, 0x64, 0x64, 0x65, + 0x72, 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, 0x55, 0x0a, 0x1c, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x42, 0x69, 0x64, + 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, + 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x69, 0x64, + 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x69, 0x64, 0x64, 0x65, + 0x72, 0x22, 0x77, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, + 0x6f, 0x77, 0x65, 0x64, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x62, 0x69, + 0x64, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x66, 0x75, 0x6e, + 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, + 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x42, + 0x69, 0x64, 0x64, 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0d, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x65, 0x64, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x22, 0x4a, 0x0a, 0x12, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x42, 0x69, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, + 0x15, 0x0a, 0x06, 0x62, 0x69, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x05, 0x62, 0x69, 0x64, 0x49, 0x64, 0x22, 0x4e, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, + 0x65, 0x74, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, + 0x03, 0x62, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x66, 0x75, 0x6e, + 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, + 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x64, 0x42, 0x04, 0xc8, 0xde, 0x1f, + 0x00, 0x52, 0x03, 0x62, 0x69, 0x64, 0x22, 0xb2, 0x01, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x41, 0x6c, 0x6c, 0x42, 0x69, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, + 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x69, + 0x64, 0x64, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x73, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x64, 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, 0x22, 0x97, 0x01, 0x0a, 0x13, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x03, 0x62, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, + 0x64, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x03, 0x62, 0x69, 0x64, 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, 0x84, 0x01, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, + 0x6c, 0x6c, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x51, 0x75, 0x65, 0x75, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 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, 0xbb, 0x01, 0x0a, + 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x51, 0x75, 0x65, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, + 0x0c, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x51, 0x75, 0x65, 0x75, 0x65, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, + 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, + 0x2e, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x51, 0x75, 0x65, 0x75, 0x65, 0x42, 0x04, 0xc8, + 0xde, 0x1f, 0x00, 0x52, 0x0c, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x51, 0x75, 0x65, 0x75, + 0x65, 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, 0x93, 0x0c, 0x0a, 0x05, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x12, 0xa0, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x2e, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2f, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, + 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, + 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xab, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, + 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, + 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x41, 0x75, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, + 0x6c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, + 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x75, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xb7, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x75, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, + 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, + 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, + 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x75, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x12, 0x38, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, + 0x6e, 0x74, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x7b, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x12, + 0xd9, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x42, + 0x69, 0x64, 0x64, 0x65, 0x72, 0x12, 0x38, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, + 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x41, 0x6c, 0x6c, 0x6f, 0x77, + 0x65, 0x64, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x39, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x42, 0x69, 0x64, 0x64, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4f, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x49, 0x12, 0x47, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, + 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, + 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, + 0x7b, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x12, 0xe1, 0x01, 0x0a, 0x10, + 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, + 0x12, 0x38, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x42, 0x69, 0x64, + 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x66, 0x75, 0x6e, + 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, + 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, + 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x52, 0x12, 0x50, 0x2f, + 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, + 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, + 0x6e, 0x67, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x61, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, + 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x7b, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x7d, 0x12, + 0xb0, 0x01, 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x69, 0x64, 0x12, 0x2e, 0x2e, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, + 0x6c, 0x42, 0x69, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, + 0x6c, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x3e, 0x12, 0x3c, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x74, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x7b, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x62, + 0x69, 0x64, 0x12, 0xb8, 0x01, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x42, 0x69, 0x64, 0x12, 0x2e, 0x2e, + 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, + 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x47, 0x65, 0x74, 0x42, 0x69, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, + 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, + 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x47, 0x65, 0x74, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x47, 0x12, 0x45, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x74, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, + 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, + 0x2f, 0x62, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x64, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0xd0, 0x01, + 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x51, 0x75, 0x65, + 0x75, 0x65, 0x12, 0x37, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, + 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x51, + 0x75, 0x65, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, + 0x6c, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x51, 0x75, 0x65, 0x75, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x49, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x43, 0x12, 0x41, 0x2f, + 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, + 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, + 0x6e, 0x67, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x61, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, + 0x42, 0x86, 0x02, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, + 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, + 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, + 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, + 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, + 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x46, 0x46, 0x58, 0xaa, 0x02, 0x1a, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, + 0x67, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1a, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, + 0x6e, 0x67, 0x5c, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x26, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, + 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x46, 0x75, 0x6e, + 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_fundraising_fundraising_v1_query_proto_rawDescOnce sync.Once + file_fundraising_fundraising_v1_query_proto_rawDescData = file_fundraising_fundraising_v1_query_proto_rawDesc +) + +func file_fundraising_fundraising_v1_query_proto_rawDescGZIP() []byte { + file_fundraising_fundraising_v1_query_proto_rawDescOnce.Do(func() { + file_fundraising_fundraising_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_fundraising_fundraising_v1_query_proto_rawDescData) + }) + return file_fundraising_fundraising_v1_query_proto_rawDescData +} + +var ( + file_fundraising_fundraising_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 16) + file_fundraising_fundraising_v1_query_proto_goTypes = []interface{}{ + (*QueryParamsRequest)(nil), // 0: fundraising.fundraising.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: fundraising.fundraising.v1.QueryParamsResponse + (*QueryAllAuctionRequest)(nil), // 2: fundraising.fundraising.v1.QueryAllAuctionRequest + (*QueryAllAuctionResponse)(nil), // 3: fundraising.fundraising.v1.QueryAllAuctionResponse + (*QueryGetAuctionRequest)(nil), // 4: fundraising.fundraising.v1.QueryGetAuctionRequest + (*QueryGetAuctionResponse)(nil), // 5: fundraising.fundraising.v1.QueryGetAuctionResponse + (*QueryAllAllowedBidderRequest)(nil), // 6: fundraising.fundraising.v1.QueryAllAllowedBidderRequest + (*QueryAllAllowedBidderResponse)(nil), // 7: fundraising.fundraising.v1.QueryAllAllowedBidderResponse + (*QueryGetAllowedBidderRequest)(nil), // 8: fundraising.fundraising.v1.QueryGetAllowedBidderRequest + (*QueryGetAllowedBidderResponse)(nil), // 9: fundraising.fundraising.v1.QueryGetAllowedBidderResponse + (*QueryGetBidRequest)(nil), // 10: fundraising.fundraising.v1.QueryGetBidRequest + (*QueryGetBidResponse)(nil), // 11: fundraising.fundraising.v1.QueryGetBidResponse + (*QueryAllBidRequest)(nil), // 12: fundraising.fundraising.v1.QueryAllBidRequest + (*QueryAllBidResponse)(nil), // 13: fundraising.fundraising.v1.QueryAllBidResponse + (*QueryAllVestingQueueRequest)(nil), // 14: fundraising.fundraising.v1.QueryAllVestingQueueRequest + (*QueryAllVestingQueueResponse)(nil), // 15: fundraising.fundraising.v1.QueryAllVestingQueueResponse + (*Params)(nil), // 16: fundraising.fundraising.v1.Params + (*v1beta1.PageRequest)(nil), // 17: cosmos.base.query.v1beta1.PageRequest + (*anypb.Any)(nil), // 18: google.protobuf.Any + (*v1beta1.PageResponse)(nil), // 19: cosmos.base.query.v1beta1.PageResponse + (*AllowedBidder)(nil), // 20: fundraising.fundraising.v1.AllowedBidder + (*Bid)(nil), // 21: fundraising.fundraising.v1.Bid + (*VestingQueue)(nil), // 22: fundraising.fundraising.v1.VestingQueue + } +) + +var file_fundraising_fundraising_v1_query_proto_depIdxs = []int32{ + 16, // 0: fundraising.fundraising.v1.QueryParamsResponse.params:type_name -> fundraising.fundraising.v1.Params + 17, // 1: fundraising.fundraising.v1.QueryAllAuctionRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 18, // 2: fundraising.fundraising.v1.QueryAllAuctionResponse.auction:type_name -> google.protobuf.Any + 19, // 3: fundraising.fundraising.v1.QueryAllAuctionResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 18, // 4: fundraising.fundraising.v1.QueryGetAuctionResponse.auction:type_name -> google.protobuf.Any + 17, // 5: fundraising.fundraising.v1.QueryAllAllowedBidderRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 20, // 6: fundraising.fundraising.v1.QueryAllAllowedBidderResponse.allowed_bidder:type_name -> fundraising.fundraising.v1.AllowedBidder + 19, // 7: fundraising.fundraising.v1.QueryAllAllowedBidderResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 20, // 8: fundraising.fundraising.v1.QueryGetAllowedBidderResponse.allowed_bidder:type_name -> fundraising.fundraising.v1.AllowedBidder + 21, // 9: fundraising.fundraising.v1.QueryGetBidResponse.bid:type_name -> fundraising.fundraising.v1.Bid + 17, // 10: fundraising.fundraising.v1.QueryAllBidRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 21, // 11: fundraising.fundraising.v1.QueryAllBidResponse.bid:type_name -> fundraising.fundraising.v1.Bid + 19, // 12: fundraising.fundraising.v1.QueryAllBidResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 17, // 13: fundraising.fundraising.v1.QueryAllVestingQueueRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 22, // 14: fundraising.fundraising.v1.QueryAllVestingQueueResponse.vestingQueue:type_name -> fundraising.fundraising.v1.VestingQueue + 19, // 15: fundraising.fundraising.v1.QueryAllVestingQueueResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 0, // 16: fundraising.fundraising.v1.Query.Params:input_type -> fundraising.fundraising.v1.QueryParamsRequest + 2, // 17: fundraising.fundraising.v1.Query.ListAuction:input_type -> fundraising.fundraising.v1.QueryAllAuctionRequest + 4, // 18: fundraising.fundraising.v1.Query.GetAuction:input_type -> fundraising.fundraising.v1.QueryGetAuctionRequest + 6, // 19: fundraising.fundraising.v1.Query.ListAllowedBidder:input_type -> fundraising.fundraising.v1.QueryAllAllowedBidderRequest + 8, // 20: fundraising.fundraising.v1.Query.GetAllowedBidder:input_type -> fundraising.fundraising.v1.QueryGetAllowedBidderRequest + 12, // 21: fundraising.fundraising.v1.Query.ListBid:input_type -> fundraising.fundraising.v1.QueryAllBidRequest + 10, // 22: fundraising.fundraising.v1.Query.GetBid:input_type -> fundraising.fundraising.v1.QueryGetBidRequest + 14, // 23: fundraising.fundraising.v1.Query.ListVestingQueue:input_type -> fundraising.fundraising.v1.QueryAllVestingQueueRequest + 1, // 24: fundraising.fundraising.v1.Query.Params:output_type -> fundraising.fundraising.v1.QueryParamsResponse + 3, // 25: fundraising.fundraising.v1.Query.ListAuction:output_type -> fundraising.fundraising.v1.QueryAllAuctionResponse + 5, // 26: fundraising.fundraising.v1.Query.GetAuction:output_type -> fundraising.fundraising.v1.QueryGetAuctionResponse + 7, // 27: fundraising.fundraising.v1.Query.ListAllowedBidder:output_type -> fundraising.fundraising.v1.QueryAllAllowedBidderResponse + 9, // 28: fundraising.fundraising.v1.Query.GetAllowedBidder:output_type -> fundraising.fundraising.v1.QueryGetAllowedBidderResponse + 13, // 29: fundraising.fundraising.v1.Query.ListBid:output_type -> fundraising.fundraising.v1.QueryAllBidResponse + 11, // 30: fundraising.fundraising.v1.Query.GetBid:output_type -> fundraising.fundraising.v1.QueryGetBidResponse + 15, // 31: fundraising.fundraising.v1.Query.ListVestingQueue:output_type -> fundraising.fundraising.v1.QueryAllVestingQueueResponse + 24, // [24:32] is the sub-list for method output_type + 16, // [16:24] 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_fundraising_fundraising_v1_query_proto_init() } +func file_fundraising_fundraising_v1_query_proto_init() { + if File_fundraising_fundraising_v1_query_proto != nil { + return + } + file_fundraising_fundraising_v1_allowed_bidder_proto_init() + file_fundraising_fundraising_v1_auction_proto_init() + file_fundraising_fundraising_v1_bid_proto_init() + file_fundraising_fundraising_v1_params_proto_init() + file_fundraising_fundraising_v1_vesting_queue_proto_init() + if !protoimpl.UnsafeEnabled { + file_fundraising_fundraising_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllAuctionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllAuctionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetAuctionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetAuctionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllAllowedBidderRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllAllowedBidderResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_query_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetAllowedBidderRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_query_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetAllowedBidderResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_query_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetBidRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_query_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetBidResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_query_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllBidRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_query_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllBidResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_query_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllVestingQueueRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_query_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllVestingQueueResponse); 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_fundraising_fundraising_v1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 16, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_fundraising_fundraising_v1_query_proto_goTypes, + DependencyIndexes: file_fundraising_fundraising_v1_query_proto_depIdxs, + MessageInfos: file_fundraising_fundraising_v1_query_proto_msgTypes, + }.Build() + File_fundraising_fundraising_v1_query_proto = out.File + file_fundraising_fundraising_v1_query_proto_rawDesc = nil + file_fundraising_fundraising_v1_query_proto_goTypes = nil + file_fundraising_fundraising_v1_query_proto_depIdxs = nil +} diff --git a/api/fundraising/fundraising/v1/query_grpc.pb.go b/api/fundraising/fundraising/v1/query_grpc.pb.go new file mode 100644 index 00000000..aaf88f2d --- /dev/null +++ b/api/fundraising/fundraising/v1/query_grpc.pb.go @@ -0,0 +1,379 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: fundraising/fundraising/v1/query.proto + +package fundraisingv1 + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Query_Params_FullMethodName = "/fundraising.fundraising.v1.Query/Params" + Query_ListAuction_FullMethodName = "/fundraising.fundraising.v1.Query/ListAuction" + Query_GetAuction_FullMethodName = "/fundraising.fundraising.v1.Query/GetAuction" + Query_ListAllowedBidder_FullMethodName = "/fundraising.fundraising.v1.Query/ListAllowedBidder" + Query_GetAllowedBidder_FullMethodName = "/fundraising.fundraising.v1.Query/GetAllowedBidder" + Query_ListBid_FullMethodName = "/fundraising.fundraising.v1.Query/ListBid" + Query_GetBid_FullMethodName = "/fundraising.fundraising.v1.Query/GetBid" + Query_ListVestingQueue_FullMethodName = "/fundraising.fundraising.v1.Query/ListVestingQueue" +) + +// 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 { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Queries a list of Auction items. + ListAuction(ctx context.Context, in *QueryAllAuctionRequest, opts ...grpc.CallOption) (*QueryAllAuctionResponse, error) + GetAuction(ctx context.Context, in *QueryGetAuctionRequest, opts ...grpc.CallOption) (*QueryGetAuctionResponse, error) + // Queries a list of AllowedBidder items. + ListAllowedBidder(ctx context.Context, in *QueryAllAllowedBidderRequest, opts ...grpc.CallOption) (*QueryAllAllowedBidderResponse, error) + GetAllowedBidder(ctx context.Context, in *QueryGetAllowedBidderRequest, opts ...grpc.CallOption) (*QueryGetAllowedBidderResponse, error) + // Queries a list of Bid items. + ListBid(ctx context.Context, in *QueryAllBidRequest, opts ...grpc.CallOption) (*QueryAllBidResponse, error) + GetBid(ctx context.Context, in *QueryGetBidRequest, opts ...grpc.CallOption) (*QueryGetBidResponse, error) + // Queries a list of VestingQueue items. + ListVestingQueue(ctx context.Context, in *QueryAllVestingQueueRequest, opts ...grpc.CallOption) (*QueryAllVestingQueueResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ListAuction(ctx context.Context, in *QueryAllAuctionRequest, opts ...grpc.CallOption) (*QueryAllAuctionResponse, error) { + out := new(QueryAllAuctionResponse) + err := c.cc.Invoke(ctx, Query_ListAuction_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GetAuction(ctx context.Context, in *QueryGetAuctionRequest, opts ...grpc.CallOption) (*QueryGetAuctionResponse, error) { + out := new(QueryGetAuctionResponse) + err := c.cc.Invoke(ctx, Query_GetAuction_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ListAllowedBidder(ctx context.Context, in *QueryAllAllowedBidderRequest, opts ...grpc.CallOption) (*QueryAllAllowedBidderResponse, error) { + out := new(QueryAllAllowedBidderResponse) + err := c.cc.Invoke(ctx, Query_ListAllowedBidder_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GetAllowedBidder(ctx context.Context, in *QueryGetAllowedBidderRequest, opts ...grpc.CallOption) (*QueryGetAllowedBidderResponse, error) { + out := new(QueryGetAllowedBidderResponse) + err := c.cc.Invoke(ctx, Query_GetAllowedBidder_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ListBid(ctx context.Context, in *QueryAllBidRequest, opts ...grpc.CallOption) (*QueryAllBidResponse, error) { + out := new(QueryAllBidResponse) + err := c.cc.Invoke(ctx, Query_ListBid_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GetBid(ctx context.Context, in *QueryGetBidRequest, opts ...grpc.CallOption) (*QueryGetBidResponse, error) { + out := new(QueryGetBidResponse) + err := c.cc.Invoke(ctx, Query_GetBid_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ListVestingQueue(ctx context.Context, in *QueryAllVestingQueueRequest, opts ...grpc.CallOption) (*QueryAllVestingQueueResponse, error) { + out := new(QueryAllVestingQueueResponse) + err := c.cc.Invoke(ctx, Query_ListVestingQueue_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 { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a list of Auction items. + ListAuction(context.Context, *QueryAllAuctionRequest) (*QueryAllAuctionResponse, error) + GetAuction(context.Context, *QueryGetAuctionRequest) (*QueryGetAuctionResponse, error) + // Queries a list of AllowedBidder items. + ListAllowedBidder(context.Context, *QueryAllAllowedBidderRequest) (*QueryAllAllowedBidderResponse, error) + GetAllowedBidder(context.Context, *QueryGetAllowedBidderRequest) (*QueryGetAllowedBidderResponse, error) + // Queries a list of Bid items. + ListBid(context.Context, *QueryAllBidRequest) (*QueryAllBidResponse, error) + GetBid(context.Context, *QueryGetBidRequest) (*QueryGetBidResponse, error) + // Queries a list of VestingQueue items. + ListVestingQueue(context.Context, *QueryAllVestingQueueRequest) (*QueryAllVestingQueueResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) ListAuction(context.Context, *QueryAllAuctionRequest) (*QueryAllAuctionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAuction not implemented") +} +func (UnimplementedQueryServer) GetAuction(context.Context, *QueryGetAuctionRequest) (*QueryGetAuctionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAuction not implemented") +} +func (UnimplementedQueryServer) ListAllowedBidder(context.Context, *QueryAllAllowedBidderRequest) (*QueryAllAllowedBidderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAllowedBidder not implemented") +} +func (UnimplementedQueryServer) GetAllowedBidder(context.Context, *QueryGetAllowedBidderRequest) (*QueryGetAllowedBidderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAllowedBidder not implemented") +} +func (UnimplementedQueryServer) ListBid(context.Context, *QueryAllBidRequest) (*QueryAllBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListBid not implemented") +} +func (UnimplementedQueryServer) GetBid(context.Context, *QueryGetBidRequest) (*QueryGetBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBid not implemented") +} +func (UnimplementedQueryServer) ListVestingQueue(context.Context, *QueryAllVestingQueueRequest) (*QueryAllVestingQueueResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListVestingQueue not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ListAuction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllAuctionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ListAuction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_ListAuction_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ListAuction(ctx, req.(*QueryAllAuctionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GetAuction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetAuctionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetAuction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_GetAuction_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetAuction(ctx, req.(*QueryGetAuctionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ListAllowedBidder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllAllowedBidderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ListAllowedBidder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_ListAllowedBidder_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ListAllowedBidder(ctx, req.(*QueryAllAllowedBidderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GetAllowedBidder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetAllowedBidderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetAllowedBidder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_GetAllowedBidder_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetAllowedBidder(ctx, req.(*QueryGetAllowedBidderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ListBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllBidRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ListBid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_ListBid_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ListBid(ctx, req.(*QueryAllBidRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GetBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetBidRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetBid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_GetBid_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetBid(ctx, req.(*QueryGetBidRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ListVestingQueue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllVestingQueueRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ListVestingQueue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_ListVestingQueue_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ListVestingQueue(ctx, req.(*QueryAllVestingQueueRequest)) + } + 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: "fundraising.fundraising.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "ListAuction", + Handler: _Query_ListAuction_Handler, + }, + { + MethodName: "GetAuction", + Handler: _Query_GetAuction_Handler, + }, + { + MethodName: "ListAllowedBidder", + Handler: _Query_ListAllowedBidder_Handler, + }, + { + MethodName: "GetAllowedBidder", + Handler: _Query_GetAllowedBidder_Handler, + }, + { + MethodName: "ListBid", + Handler: _Query_ListBid_Handler, + }, + { + MethodName: "GetBid", + Handler: _Query_GetBid_Handler, + }, + { + MethodName: "ListVestingQueue", + Handler: _Query_ListVestingQueue_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "fundraising/fundraising/v1/query.proto", +} diff --git a/api/fundraising/fundraising/v1/tx.pulsar.go b/api/fundraising/fundraising/v1/tx.pulsar.go new file mode 100644 index 00000000..fc5d54aa --- /dev/null +++ b/api/fundraising/fundraising/v1/tx.pulsar.go @@ -0,0 +1,1110 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package fundraisingv1 + +import ( + fmt "fmt" + io "io" + reflect "reflect" + sync "sync" + + _ "cosmossdk.io/api/amino" + _ "cosmossdk.io/api/cosmos/msg/v1" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +var ( + md_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_tx_proto_init() + md_MsgUpdateParams = File_fundraising_fundraising_v1_tx_proto.Messages().ByName("MsgUpdateParams") + fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") + fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) + +type fastReflection_MsgUpdateParams MsgUpdateParams + +func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(x) +} + +func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_tx_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var ( + _fastReflection_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType + _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} +) + +type fastReflection_MsgUpdateParams_messageType struct{} + +func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(nil) +} + +func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} + +func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateParams) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParams)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateParams_authority, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgUpdateParams_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.MsgUpdateParams.authority": + return x.Authority != "" + case "fundraising.fundraising.v1.MsgUpdateParams.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.MsgUpdateParams.authority": + x.Authority = "" + case "fundraising.fundraising.v1.MsgUpdateParams.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "fundraising.fundraising.v1.MsgUpdateParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.MsgUpdateParams does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "fundraising.fundraising.v1.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "fundraising.fundraising.v1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message fundraising.fundraising.v1.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "fundraising.fundraising.v1.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.MsgUpdateParams", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParams) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParams) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var md_MsgUpdateParamsResponse protoreflect.MessageDescriptor + +func init() { + file_fundraising_fundraising_v1_tx_proto_init() + md_MsgUpdateParamsResponse = File_fundraising_fundraising_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) + +type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse + +func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(x) +} + +func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_tx_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var ( + _fastReflection_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType + _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} +) + +type fastReflection_MsgUpdateParamsResponse_messageType struct{} + +func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(nil) +} + +func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} + +func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.MsgUpdateParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.MsgUpdateParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: fundraising/fundraising/v1/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the module parameters to update. + // + // NOTE: All parameters must be supplied. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParams) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParamsResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_tx_proto_rawDescGZIP(), []int{1} +} + +var File_fundraising_fundraising_v1_tx_proto protoreflect.FileDescriptor + +var file_fundraising_fundraising_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, + 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, + 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 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, 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, 0x27, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, + 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, + 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xce, 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, 0x45, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, + 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 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, 0x3c, 0x82, 0xe7, 0xb0, 0x2a, + 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x29, 0x66, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x78, 0x2f, 0x66, 0x75, 0x6e, + 0x64, 0x72, 0x61, 0x69, 0x73, 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, 0x7e, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x70, 0x0a, 0x0c, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2b, 0x2e, 0x66, 0x75, 0x6e, + 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, + 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x33, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, + 0x67, 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, 0x83, 0x02, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x66, 0x75, 0x6e, 0x64, + 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, + 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, + 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, + 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, + 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x46, 0x46, 0x58, 0xaa, 0x02, 0x1a, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, + 0x67, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1a, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, + 0x6e, 0x67, 0x5c, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x26, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, + 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x46, 0x75, 0x6e, + 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_fundraising_fundraising_v1_tx_proto_rawDescOnce sync.Once + file_fundraising_fundraising_v1_tx_proto_rawDescData = file_fundraising_fundraising_v1_tx_proto_rawDesc +) + +func file_fundraising_fundraising_v1_tx_proto_rawDescGZIP() []byte { + file_fundraising_fundraising_v1_tx_proto_rawDescOnce.Do(func() { + file_fundraising_fundraising_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_fundraising_fundraising_v1_tx_proto_rawDescData) + }) + return file_fundraising_fundraising_v1_tx_proto_rawDescData +} + +var ( + file_fundraising_fundraising_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) + file_fundraising_fundraising_v1_tx_proto_goTypes = []interface{}{ + (*MsgUpdateParams)(nil), // 0: fundraising.fundraising.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: fundraising.fundraising.v1.MsgUpdateParamsResponse + (*Params)(nil), // 2: fundraising.fundraising.v1.Params + } +) + +var file_fundraising_fundraising_v1_tx_proto_depIdxs = []int32{ + 2, // 0: fundraising.fundraising.v1.MsgUpdateParams.params:type_name -> fundraising.fundraising.v1.Params + 0, // 1: fundraising.fundraising.v1.Msg.UpdateParams:input_type -> fundraising.fundraising.v1.MsgUpdateParams + 1, // 2: fundraising.fundraising.v1.Msg.UpdateParams:output_type -> fundraising.fundraising.v1.MsgUpdateParamsResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_fundraising_fundraising_v1_tx_proto_init() } +func file_fundraising_fundraising_v1_tx_proto_init() { + if File_fundraising_fundraising_v1_tx_proto != nil { + return + } + file_fundraising_fundraising_v1_params_proto_init() + if !protoimpl.UnsafeEnabled { + file_fundraising_fundraising_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fundraising_fundraising_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_fundraising_fundraising_v1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_fundraising_fundraising_v1_tx_proto_goTypes, + DependencyIndexes: file_fundraising_fundraising_v1_tx_proto_depIdxs, + MessageInfos: file_fundraising_fundraising_v1_tx_proto_msgTypes, + }.Build() + File_fundraising_fundraising_v1_tx_proto = out.File + file_fundraising_fundraising_v1_tx_proto_rawDesc = nil + file_fundraising_fundraising_v1_tx_proto_goTypes = nil + file_fundraising_fundraising_v1_tx_proto_depIdxs = nil +} diff --git a/api/fundraising/fundraising/v1/tx_grpc.pb.go b/api/fundraising/fundraising/v1/tx_grpc.pb.go new file mode 100644 index 00000000..760f5a0e --- /dev/null +++ b/api/fundraising/fundraising/v1/tx_grpc.pb.go @@ -0,0 +1,114 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: fundraising/fundraising/v1/tx.proto + +package fundraisingv1 + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Msg_UpdateParams_FullMethodName = "/fundraising.fundraising.v1.Msg/UpdateParams" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "fundraising.fundraising.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "fundraising/fundraising/v1/tx.proto", +} diff --git a/api/fundraising/fundraising/v1/vesting_queue.pulsar.go b/api/fundraising/fundraising/v1/vesting_queue.pulsar.go new file mode 100644 index 00000000..9b30a0fd --- /dev/null +++ b/api/fundraising/fundraising/v1/vesting_queue.pulsar.go @@ -0,0 +1,915 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package fundraisingv1 + +import ( + fmt "fmt" + io "io" + reflect "reflect" + sync "sync" + + _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" +) + +var ( + md_VestingQueue protoreflect.MessageDescriptor + fd_VestingQueue_auction_id protoreflect.FieldDescriptor + fd_VestingQueue_auctioneer protoreflect.FieldDescriptor + fd_VestingQueue_paying_coin protoreflect.FieldDescriptor + fd_VestingQueue_release_time protoreflect.FieldDescriptor + fd_VestingQueue_released protoreflect.FieldDescriptor +) + +func init() { + file_fundraising_fundraising_v1_vesting_queue_proto_init() + md_VestingQueue = File_fundraising_fundraising_v1_vesting_queue_proto.Messages().ByName("VestingQueue") + fd_VestingQueue_auction_id = md_VestingQueue.Fields().ByName("auction_id") + fd_VestingQueue_auctioneer = md_VestingQueue.Fields().ByName("auctioneer") + fd_VestingQueue_paying_coin = md_VestingQueue.Fields().ByName("paying_coin") + fd_VestingQueue_release_time = md_VestingQueue.Fields().ByName("release_time") + fd_VestingQueue_released = md_VestingQueue.Fields().ByName("released") +} + +var _ protoreflect.Message = (*fastReflection_VestingQueue)(nil) + +type fastReflection_VestingQueue VestingQueue + +func (x *VestingQueue) ProtoReflect() protoreflect.Message { + return (*fastReflection_VestingQueue)(x) +} + +func (x *VestingQueue) slowProtoReflect() protoreflect.Message { + mi := &file_fundraising_fundraising_v1_vesting_queue_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_VestingQueue_messageType fastReflection_VestingQueue_messageType + _ protoreflect.MessageType = fastReflection_VestingQueue_messageType{} +) + +type fastReflection_VestingQueue_messageType struct{} + +func (x fastReflection_VestingQueue_messageType) Zero() protoreflect.Message { + return (*fastReflection_VestingQueue)(nil) +} + +func (x fastReflection_VestingQueue_messageType) New() protoreflect.Message { + return new(fastReflection_VestingQueue) +} + +func (x fastReflection_VestingQueue_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_VestingQueue +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_VestingQueue) Descriptor() protoreflect.MessageDescriptor { + return md_VestingQueue +} + +// 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_VestingQueue) Type() protoreflect.MessageType { + return _fastReflection_VestingQueue_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_VestingQueue) New() protoreflect.Message { + return new(fastReflection_VestingQueue) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_VestingQueue) Interface() protoreflect.ProtoMessage { + return (*VestingQueue)(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_VestingQueue) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AuctionId != uint64(0) { + value := protoreflect.ValueOfUint64(x.AuctionId) + if !f(fd_VestingQueue_auction_id, value) { + return + } + } + if x.Auctioneer != "" { + value := protoreflect.ValueOfString(x.Auctioneer) + if !f(fd_VestingQueue_auctioneer, value) { + return + } + } + if x.PayingCoin != nil { + value := protoreflect.ValueOfMessage(x.PayingCoin.ProtoReflect()) + if !f(fd_VestingQueue_paying_coin, value) { + return + } + } + if x.ReleaseTime != nil { + value := protoreflect.ValueOfMessage(x.ReleaseTime.ProtoReflect()) + if !f(fd_VestingQueue_release_time, value) { + return + } + } + if x.Released != false { + value := protoreflect.ValueOfBool(x.Released) + if !f(fd_VestingQueue_released, 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_VestingQueue) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "fundraising.fundraising.v1.VestingQueue.auction_id": + return x.AuctionId != uint64(0) + case "fundraising.fundraising.v1.VestingQueue.auctioneer": + return x.Auctioneer != "" + case "fundraising.fundraising.v1.VestingQueue.paying_coin": + return x.PayingCoin != nil + case "fundraising.fundraising.v1.VestingQueue.release_time": + return x.ReleaseTime != nil + case "fundraising.fundraising.v1.VestingQueue.released": + return x.Released != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.VestingQueue")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.VestingQueue 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_VestingQueue) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "fundraising.fundraising.v1.VestingQueue.auction_id": + x.AuctionId = uint64(0) + case "fundraising.fundraising.v1.VestingQueue.auctioneer": + x.Auctioneer = "" + case "fundraising.fundraising.v1.VestingQueue.paying_coin": + x.PayingCoin = nil + case "fundraising.fundraising.v1.VestingQueue.release_time": + x.ReleaseTime = nil + case "fundraising.fundraising.v1.VestingQueue.released": + x.Released = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.VestingQueue")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.VestingQueue 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_VestingQueue) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "fundraising.fundraising.v1.VestingQueue.auction_id": + value := x.AuctionId + return protoreflect.ValueOfUint64(value) + case "fundraising.fundraising.v1.VestingQueue.auctioneer": + value := x.Auctioneer + return protoreflect.ValueOfString(value) + case "fundraising.fundraising.v1.VestingQueue.paying_coin": + value := x.PayingCoin + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "fundraising.fundraising.v1.VestingQueue.release_time": + value := x.ReleaseTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "fundraising.fundraising.v1.VestingQueue.released": + value := x.Released + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.VestingQueue")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.VestingQueue 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_VestingQueue) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "fundraising.fundraising.v1.VestingQueue.auction_id": + x.AuctionId = value.Uint() + case "fundraising.fundraising.v1.VestingQueue.auctioneer": + x.Auctioneer = value.Interface().(string) + case "fundraising.fundraising.v1.VestingQueue.paying_coin": + x.PayingCoin = value.Message().Interface().(*v1beta1.Coin) + case "fundraising.fundraising.v1.VestingQueue.release_time": + x.ReleaseTime = value.Message().Interface().(*timestamppb.Timestamp) + case "fundraising.fundraising.v1.VestingQueue.released": + x.Released = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.VestingQueue")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.VestingQueue 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_VestingQueue) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.VestingQueue.paying_coin": + if x.PayingCoin == nil { + x.PayingCoin = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.PayingCoin.ProtoReflect()) + case "fundraising.fundraising.v1.VestingQueue.release_time": + if x.ReleaseTime == nil { + x.ReleaseTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.ReleaseTime.ProtoReflect()) + case "fundraising.fundraising.v1.VestingQueue.auction_id": + panic(fmt.Errorf("field auction_id of message fundraising.fundraising.v1.VestingQueue is not mutable")) + case "fundraising.fundraising.v1.VestingQueue.auctioneer": + panic(fmt.Errorf("field auctioneer of message fundraising.fundraising.v1.VestingQueue is not mutable")) + case "fundraising.fundraising.v1.VestingQueue.released": + panic(fmt.Errorf("field released of message fundraising.fundraising.v1.VestingQueue is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.VestingQueue")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.VestingQueue 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_VestingQueue) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "fundraising.fundraising.v1.VestingQueue.auction_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "fundraising.fundraising.v1.VestingQueue.auctioneer": + return protoreflect.ValueOfString("") + case "fundraising.fundraising.v1.VestingQueue.paying_coin": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "fundraising.fundraising.v1.VestingQueue.release_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "fundraising.fundraising.v1.VestingQueue.released": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: fundraising.fundraising.v1.VestingQueue")) + } + panic(fmt.Errorf("message fundraising.fundraising.v1.VestingQueue 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_VestingQueue) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in fundraising.fundraising.v1.VestingQueue", 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_VestingQueue) 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_VestingQueue) 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_VestingQueue) 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_VestingQueue) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*VestingQueue) + 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.AuctionId != 0 { + n += 1 + runtime.Sov(uint64(x.AuctionId)) + } + l = len(x.Auctioneer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.PayingCoin != nil { + l = options.Size(x.PayingCoin) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ReleaseTime != nil { + l = options.Size(x.ReleaseTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Released { + 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().(*VestingQueue) + 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.Released { + i-- + if x.Released { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if x.ReleaseTime != nil { + encoded, err := options.Marshal(x.ReleaseTime) + 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.PayingCoin != nil { + encoded, err := options.Marshal(x.PayingCoin) + 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.Auctioneer) > 0 { + i -= len(x.Auctioneer) + copy(dAtA[i:], x.Auctioneer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Auctioneer))) + i-- + dAtA[i] = 0x12 + } + if x.AuctionId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AuctionId)) + 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().(*VestingQueue) + 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: VestingQueue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: VestingQueue: 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 AuctionId", wireType) + } + x.AuctionId = 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.AuctionId |= 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 Auctioneer", 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.Auctioneer = 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 PayingCoin", 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.PayingCoin == nil { + x.PayingCoin = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PayingCoin); 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 ReleaseTime", 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.ReleaseTime == nil { + x.ReleaseTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ReleaseTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Released", 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.Released = 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: fundraising/fundraising/v1/vesting_queue.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) +) + +// VestingQueue defines the vesting queue. +type VestingQueue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // auction_id specifies the id of the auction + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + // auctioneer specifies the bech32-encoded address that creates the auction + Auctioneer string `protobuf:"bytes,2,opt,name=auctioneer,proto3" json:"auctioneer,omitempty"` + // paying_coin specifies the paying amount of coin + PayingCoin *v1beta1.Coin `protobuf:"bytes,3,opt,name=paying_coin,json=payingCoin,proto3" json:"paying_coin,omitempty"` + // release_time specifies the timestamp of the vesting schedule + ReleaseTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=release_time,json=releaseTime,proto3" json:"release_time,omitempty"` + // released specifies the status of distribution + Released bool `protobuf:"varint,5,opt,name=released,proto3" json:"released,omitempty"` +} + +func (x *VestingQueue) Reset() { + *x = VestingQueue{} + if protoimpl.UnsafeEnabled { + mi := &file_fundraising_fundraising_v1_vesting_queue_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VestingQueue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VestingQueue) ProtoMessage() {} + +// Deprecated: Use VestingQueue.ProtoReflect.Descriptor instead. +func (*VestingQueue) Descriptor() ([]byte, []int) { + return file_fundraising_fundraising_v1_vesting_queue_proto_rawDescGZIP(), []int{0} +} + +func (x *VestingQueue) GetAuctionId() uint64 { + if x != nil { + return x.AuctionId + } + return 0 +} + +func (x *VestingQueue) GetAuctioneer() string { + if x != nil { + return x.Auctioneer + } + return "" +} + +func (x *VestingQueue) GetPayingCoin() *v1beta1.Coin { + if x != nil { + return x.PayingCoin + } + return nil +} + +func (x *VestingQueue) GetReleaseTime() *timestamppb.Timestamp { + if x != nil { + return x.ReleaseTime + } + return nil +} + +func (x *VestingQueue) GetReleased() bool { + if x != nil { + return x.Released + } + return false +} + +var File_fundraising_fundraising_v1_vesting_queue_proto protoreflect.FileDescriptor + +var file_fundraising_fundraising_v1_vesting_queue_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x1a, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 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, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 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, 0xb6, 0x02, 0x0a, 0x0c, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x51, 0x75, 0x65, + 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x65, + 0x72, 0x12, 0x81, 0x01, 0x0a, 0x0b, 0x70, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x69, + 0x6e, 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, 0x45, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x27, 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, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, + 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x70, 0x61, 0x79, 0x69, 0x6e, + 0x67, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x47, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x5f, 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, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, + 0x0a, 0x08, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x42, 0x8d, 0x02, 0x0a, 0x1e, 0x63, + 0x6f, 0x6d, 0x2e, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x66, + 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x42, 0x11, 0x56, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x51, 0x75, 0x65, 0x75, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, + 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, + 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x46, 0x46, 0x58, 0xaa, 0x02, 0x1a, 0x46, 0x75, 0x6e, 0x64, 0x72, + 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, + 0x6e, 0x67, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1a, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, + 0x69, 0x6e, 0x67, 0x5c, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x26, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, + 0x5c, 0x46, 0x75, 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x46, 0x75, + 0x6e, 0x64, 0x72, 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x46, 0x75, 0x6e, 0x64, 0x72, + 0x61, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_fundraising_fundraising_v1_vesting_queue_proto_rawDescOnce sync.Once + file_fundraising_fundraising_v1_vesting_queue_proto_rawDescData = file_fundraising_fundraising_v1_vesting_queue_proto_rawDesc +) + +func file_fundraising_fundraising_v1_vesting_queue_proto_rawDescGZIP() []byte { + file_fundraising_fundraising_v1_vesting_queue_proto_rawDescOnce.Do(func() { + file_fundraising_fundraising_v1_vesting_queue_proto_rawDescData = protoimpl.X.CompressGZIP(file_fundraising_fundraising_v1_vesting_queue_proto_rawDescData) + }) + return file_fundraising_fundraising_v1_vesting_queue_proto_rawDescData +} + +var ( + file_fundraising_fundraising_v1_vesting_queue_proto_msgTypes = make([]protoimpl.MessageInfo, 1) + file_fundraising_fundraising_v1_vesting_queue_proto_goTypes = []interface{}{ + (*VestingQueue)(nil), // 0: fundraising.fundraising.v1.VestingQueue + (*v1beta1.Coin)(nil), // 1: cosmos.base.v1beta1.Coin + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp + } +) + +var file_fundraising_fundraising_v1_vesting_queue_proto_depIdxs = []int32{ + 1, // 0: fundraising.fundraising.v1.VestingQueue.paying_coin:type_name -> cosmos.base.v1beta1.Coin + 2, // 1: fundraising.fundraising.v1.VestingQueue.release_time:type_name -> google.protobuf.Timestamp + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_fundraising_fundraising_v1_vesting_queue_proto_init() } +func file_fundraising_fundraising_v1_vesting_queue_proto_init() { + if File_fundraising_fundraising_v1_vesting_queue_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_fundraising_fundraising_v1_vesting_queue_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VestingQueue); 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_fundraising_fundraising_v1_vesting_queue_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_fundraising_fundraising_v1_vesting_queue_proto_goTypes, + DependencyIndexes: file_fundraising_fundraising_v1_vesting_queue_proto_depIdxs, + MessageInfos: file_fundraising_fundraising_v1_vesting_queue_proto_msgTypes, + }.Build() + File_fundraising_fundraising_v1_vesting_queue_proto = out.File + file_fundraising_fundraising_v1_vesting_queue_proto_rawDesc = nil + file_fundraising_fundraising_v1_vesting_queue_proto_goTypes = nil + file_fundraising_fundraising_v1_vesting_queue_proto_depIdxs = nil +} diff --git a/app/app.go b/app/app.go index 7a5bc741..f1bb769f 100644 --- a/app/app.go +++ b/app/app.go @@ -1,644 +1,298 @@ package app -// DONTCOVER - import ( - "encoding/json" "io" - "os" - "path/filepath" - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" - dbm "github.com/cometbft/cometbft-db" + _ "cosmossdk.io/api/cosmos/tx/config/v1" // import for side-effects + clienthelpers "cosmossdk.io/client/v2/helpers" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" + _ "cosmossdk.io/x/circuit" // import for side-effects + circuitkeeper "cosmossdk.io/x/circuit/keeper" + _ "cosmossdk.io/x/evidence" // import for side-effects + evidencekeeper "cosmossdk.io/x/evidence/keeper" + feegrantkeeper "cosmossdk.io/x/feegrant/keeper" + _ "cosmossdk.io/x/feegrant/module" // import for side-effects + nftkeeper "cosmossdk.io/x/nft/keeper" + _ "cosmossdk.io/x/nft/module" // import for side-effects + _ "cosmossdk.io/x/upgrade" // import for side-effects + upgradekeeper "cosmossdk.io/x/upgrade/keeper" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" - tmos "github.com/cometbft/cometbft/libs/os" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" - nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" - runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" + "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth" - "github.com/cosmos/cosmos-sdk/x/auth/ante" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" - authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" + _ "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" - vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - "github.com/cosmos/cosmos-sdk/x/authz" + _ "github.com/cosmos/cosmos-sdk/x/auth/vesting" // import for side-effects authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" - authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" - "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/authz/module" // import for side-effects + _ "github.com/cosmos/cosmos-sdk/x/bank" // import for side-effects bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/capability" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - "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" + _ "github.com/cosmos/cosmos-sdk/x/consensus" // import for side-effects + consensuskeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" + _ "github.com/cosmos/cosmos-sdk/x/crisis" // import for side-effects 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" + _ "github.com/cosmos/cosmos-sdk/x/distribution" // import for side-effects distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/evidence" - evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" - feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" "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" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/cosmos/cosmos-sdk/x/mint" + groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper" + _ "github.com/cosmos/cosmos-sdk/x/group/module" // import for side-effects + _ "github.com/cosmos/cosmos-sdk/x/mint" // import for side-effects 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" + _ "github.com/cosmos/cosmos-sdk/x/params" // import for side-effects 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" + _ "github.com/cosmos/cosmos-sdk/x/slashing" // import for side-effects slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/cosmos/cosmos-sdk/x/staking" + _ "github.com/cosmos/cosmos-sdk/x/staking" // import for side-effects stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/spf13/cast" - - "github.com/tendermint/fundraising/cmd" - "github.com/tendermint/fundraising/x/fundraising" - fundraisingkeeper "github.com/tendermint/fundraising/x/fundraising/keeper" - fundraisingtypes "github.com/tendermint/fundraising/x/fundraising/types" + _ "github.com/cosmos/ibc-go/modules/capability" // import for side-effects + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + _ "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts" // import for side-effects + icacontrollerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper" + icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper" + _ "github.com/cosmos/ibc-go/v8/modules/apps/29-fee" // import for side-effects + ibcfeekeeper "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/keeper" + ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" + + "github.com/tendermint/fundraising/docs" + fundraisingmodulekeeper "github.com/tendermint/fundraising/x/fundraising/keeper" ) const ( AccountAddressPrefix = "cosmos" Name = "fundraising" - DefaultChainID = "fundraising-1" ) -func getGovProposalHandlers() []govclient.ProposalHandler { - var govProposalHandlers []govclient.ProposalHandler - - govProposalHandlers = append(govProposalHandlers, - paramsclient.ProposalHandler, - upgradeclient.LegacyProposalHandler, - upgradeclient.LegacyCancelProposalHandler, - ) - - return govProposalHandlers -} - -var ( - // DefaultNodeHome default home directories for the application daemon - DefaultNodeHome string - - // ModuleBasics defines the module BasicManager is in charge of setting up basic, - // non-dependant module elements, such as codec registration - // and genesis verification. - ModuleBasics = module.NewBasicManager( - auth.AppModuleBasic{}, - genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), - bank.AppModuleBasic{}, - capability.AppModuleBasic{}, - staking.AppModuleBasic{}, - mint.AppModuleBasic{}, - distr.AppModuleBasic{}, - gov.NewAppModuleBasic(getGovProposalHandlers()), - params.AppModuleBasic{}, - slashing.AppModuleBasic{}, - feegrantmodule.AppModuleBasic{}, - upgrade.AppModuleBasic{}, - evidence.AppModuleBasic{}, - authzmodule.AppModuleBasic{}, - vesting.AppModuleBasic{}, - consensus.AppModuleBasic{}, - crisis.AppModuleBasic{}, - fundraising.AppModuleBasic{}, - ) - - // module account permissions - maccPerms = map[string][]string{ - authtypes.FeeCollectorName: nil, - distrtypes.ModuleName: nil, - minttypes.ModuleName: {authtypes.Minter}, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - govtypes.ModuleName: {authtypes.Burner}, - fundraisingtypes.ModuleName: nil, - } -) +// DefaultNodeHome default home directories for the application daemon +var DefaultNodeHome string var ( _ runtime.AppI = (*App)(nil) _ servertypes.Application = (*App)(nil) ) -func init() { - userHomeDir, err := os.UserHomeDir() - if err != nil { - panic(err) - } - - DefaultNodeHome = filepath.Join(userHomeDir, "."+Name) -} - // App 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. type App struct { - *baseapp.BaseApp - + *runtime.App legacyAmino *codec.LegacyAmino appCodec codec.Codec txConfig client.TxConfig - interfaceRegistry types.InterfaceRegistry - - invCheckPeriod uint - - // keys to access the substores - keys map[string]*storetypes.KVStoreKey - tkeys map[string]*storetypes.TransientStoreKey - memKeys map[string]*storetypes.MemoryStoreKey + interfaceRegistry codectypes.InterfaceRegistry // keepers AccountKeeper authkeeper.AccountKeeper BankKeeper bankkeeper.Keeper - CapabilityKeeper *capabilitykeeper.Keeper 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 - FundraisingKeeper fundraisingkeeper.Keeper - ConsensusParamsKeeper consensusparamkeeper.Keeper - - // the module manager - mm *module.Manager + ConsensusParamsKeeper consensuskeeper.Keeper + + SlashingKeeper slashingkeeper.Keeper + MintKeeper mintkeeper.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 + CircuitBreakerKeeper circuitkeeper.Keeper + + // IBC + IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly + CapabilityKeeper *capabilitykeeper.Keeper + IBCFeeKeeper ibcfeekeeper.Keeper + ICAControllerKeeper icacontrollerkeeper.Keeper + ICAHostKeeper icahostkeeper.Keeper + TransferKeeper ibctransferkeeper.Keeper + + // Scoped IBC + ScopedIBCKeeper capabilitykeeper.ScopedKeeper + ScopedIBCTransferKeeper capabilitykeeper.ScopedKeeper + ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper + ScopedICAHostKeeper capabilitykeeper.ScopedKeeper + ScopedKeepers map[string]capabilitykeeper.ScopedKeeper + + FundraisingKeeper fundraisingmodulekeeper.Keeper + // this line is used by starport scaffolding # stargate/app/keeperDeclaration // simulation manager sm *module.SimulationManager - - // module configurator - configurator module.Configurator } -// New returns a reference to an initialized Gaia. -func New( - logger log.Logger, - db dbm.DB, - traceStore io.Writer, - loadLatest bool, - skipUpgradeHeights map[int64]bool, - homePath string, - invCheckPeriod uint, - encodingConfig cmd.EncodingConfig, - appOpts servertypes.AppOptions, - baseAppOptions ...func(*baseapp.BaseApp), -) cmd.App { - appCodec := encodingConfig.Marshaler - cdc := encodingConfig.Amino - legacyAmino := encodingConfig.Amino - interfaceRegistry := encodingConfig.InterfaceRegistry - txConfig := encodingConfig.TxConfig - - bApp := baseapp.NewBaseApp(Name, logger, db, txConfig.TxDecoder(), baseAppOptions...) - bApp.SetCommitMultiStoreTracer(traceStore) - bApp.SetVersion(version.Version) - bApp.SetInterfaceRegistry(interfaceRegistry) - bApp.SetTxEncoder(txConfig.TxEncoder()) - - keys := sdk.NewKVStoreKeys( - authtypes.StoreKey, - banktypes.StoreKey, - stakingtypes.StoreKey, - minttypes.StoreKey, - distrtypes.StoreKey, - slashingtypes.StoreKey, - govtypes.StoreKey, - paramstypes.StoreKey, - upgradetypes.StoreKey, - feegrant.StoreKey, - evidencetypes.StoreKey, - capabilitytypes.StoreKey, - authzkeeper.StoreKey, - fundraisingtypes.StoreKey, - consensusparamtypes.StoreKey, - crisistypes.StoreKey, - ) - tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) - memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) - - app := &App{ - BaseApp: bApp, - legacyAmino: legacyAmino, - appCodec: appCodec, - txConfig: txConfig, - interfaceRegistry: interfaceRegistry, - invCheckPeriod: invCheckPeriod, - keys: keys, - tkeys: tkeys, - memKeys: memKeys, +func init() { + var err error + clienthelpers.EnvPrefix = Name + DefaultNodeHome, err = clienthelpers.GetNodeHomeDirectory("." + Name) + if err != nil { + panic(err) } +} - app.ParamsKeeper = initParamsKeeper( - appCodec, - legacyAmino, - keys[paramstypes.StoreKey], - tkeys[paramstypes.TStoreKey], - ) +// getGovProposalHandlers return the chain proposal handlers. +func getGovProposalHandlers() []govclient.ProposalHandler { + var govProposalHandlers []govclient.ProposalHandler + // this line is used by starport scaffolding # stargate/app/govProposalHandlers - // set the BaseApp's parameter store - app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[upgradetypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String()) - bApp.SetParamStore(&app.ConsensusParamsKeeper) - - // add capability keeper - app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey]) - app.CapabilityKeeper.Seal() - - // add keepers - app.AccountKeeper = authkeeper.NewAccountKeeper( - appCodec, - keys[authtypes.StoreKey], - authtypes.ProtoBaseAccount, - maccPerms, - sdk.Bech32PrefixAccAddr, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - app.BankKeeper = bankkeeper.NewBaseKeeper( - appCodec, - keys[banktypes.StoreKey], - app.AccountKeeper, - app.BlockedModuleAccountAddrs(), - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - app.FeeGrantKeeper = feegrantkeeper.NewKeeper( - appCodec, - keys[feegrant.StoreKey], - app.AccountKeeper, - ) - app.StakingKeeper = stakingkeeper.NewKeeper( - appCodec, - keys[stakingtypes.StoreKey], - app.AccountKeeper, - app.BankKeeper, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - app.MintKeeper = mintkeeper.NewKeeper( - appCodec, - keys[minttypes.StoreKey], - app.StakingKeeper, - app.AccountKeeper, - app.BankKeeper, - authtypes.FeeCollectorName, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - app.DistrKeeper = distrkeeper.NewKeeper( - appCodec, - keys[distrtypes.StoreKey], - app.AccountKeeper, - app.BankKeeper, - app.StakingKeeper, - authtypes.FeeCollectorName, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - app.SlashingKeeper = slashingkeeper.NewKeeper( - appCodec, - cdc, - keys[slashingtypes.StoreKey], - app.StakingKeeper, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - app.CrisisKeeper = crisiskeeper.NewKeeper( - appCodec, - keys[crisistypes.StoreKey], - invCheckPeriod, - app.BankKeeper, - authtypes.FeeCollectorName, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - app.UpgradeKeeper = upgradekeeper.NewKeeper( - skipUpgradeHeights, - keys[upgradetypes.StoreKey], - appCodec, - homePath, - app.BaseApp, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govProposalHandlers = append(govProposalHandlers, + paramsclient.ProposalHandler, + // this line is used by starport scaffolding # stargate/app/govProposalHandler ) - app.AuthzKeeper = authzkeeper.NewKeeper( - keys[authz.ModuleName], - appCodec, - app.MsgServiceRouter(), - app.AccountKeeper, - ) + return govProposalHandlers +} - // register the staking hooks - // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks - app.StakingKeeper.SetHooks( - stakingtypes.NewMultiStakingHooks( - // insert staking hooks receivers here - app.DistrKeeper.Hooks(), - app.SlashingKeeper.Hooks(), +// AppConfig returns the default app config. +func AppConfig() depinject.Config { + return depinject.Configs( + appConfig, + // Alternatively, load the app config from a YAML file. + // appconfig.LoadYAML(AppConfigYAML), + depinject.Supply( + // supply custom module basics + map[string]module.AppModuleBasic{ + genutiltypes.ModuleName: genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), + govtypes.ModuleName: gov.NewAppModuleBasic(getGovProposalHandlers()), + // this line is used by starport scaffolding # stargate/appConfig/moduleBasic + }, ), ) +} - // register the proposal types - govConfig := govtypes.DefaultConfig() - govKeeper := govkeeper.NewKeeper( - appCodec, - keys[govtypes.StoreKey], - app.AccountKeeper, - app.BankKeeper, - app.StakingKeeper, - app.MsgServiceRouter(), - govConfig, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - govRouter := govv1beta1.NewRouter() - govRouter. - AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)) - govKeeper.SetLegacyRouter(govRouter) - app.GovKeeper = *govKeeper.SetHooks( - govtypes.NewMultiGovHooks(), - ) - - app.FundraisingKeeper = fundraisingkeeper.NewKeeper( - appCodec, - keys[fundraisingtypes.StoreKey], - keys[fundraisingtypes.MemStoreKey], - app.GetSubspace(fundraisingtypes.ModuleName), - app.AccountKeeper, - app.BankKeeper, - app.DistrKeeper, - ) - - // create evidence Keeper for to register the IBC light client misbehaviour evidence route - evidenceKeeper := evidencekeeper.NewKeeper( - appCodec, - keys[evidencetypes.StoreKey], - app.StakingKeeper, - app.SlashingKeeper, +// New returns a reference to an initialized App. +func New( + logger log.Logger, + db dbm.DB, + traceStore io.Writer, + loadLatest bool, + appOpts servertypes.AppOptions, + baseAppOptions ...func(*baseapp.BaseApp), +) (*App, error) { + var ( + app = &App{ScopedKeepers: make(map[string]capabilitykeeper.ScopedKeeper)} + appBuilder *runtime.AppBuilder + + // merge the AppConfig and other configuration in one config + appConfig = depinject.Configs( + AppConfig(), + depinject.Supply( + appOpts, // supply app options + logger, // supply logger + // Supply with IBC keeper getter for the IBC modules with App Wiring. + // The IBC Keeper cannot be passed because it has not been initiated yet. + // Passing the getter, the app IBC Keeper will always be accessible. + // This needs to be removed after IBC supports App Wiring. + app.GetIBCKeeper, + app.GetCapabilityScopedKeeper, + + // here alternative options can be supplied to the DI container. + // those options can be used f.e to override the default behavior of some modules. + // for instance supplying a custom address codec for not using bech32 addresses. + // read the depinject documentation and depinject module wiring for more information + // on available options and how to use them. + ), + ) ) - // If evidence needs to be handled for the app, set routes in router here and seal - app.EvidenceKeeper = *evidenceKeeper - /**** Module Options ****/ + if err := depinject.Inject(appConfig, + &appBuilder, + &app.appCodec, + &app.legacyAmino, + &app.txConfig, + &app.interfaceRegistry, + &app.AccountKeeper, + &app.BankKeeper, + &app.StakingKeeper, + &app.DistrKeeper, + &app.ConsensusParamsKeeper, + &app.SlashingKeeper, + &app.MintKeeper, + &app.GovKeeper, + &app.CrisisKeeper, + &app.UpgradeKeeper, + &app.ParamsKeeper, + &app.AuthzKeeper, + &app.EvidenceKeeper, + &app.FeeGrantKeeper, + &app.NFTKeeper, + &app.GroupKeeper, + &app.CircuitBreakerKeeper, + &app.FundraisingKeeper, + ); err != nil { + panic(err) + } - // NOTE: we may consider parsing `appOpts` inside module constructors. For the moment - // we prefer to be more strict in what arguments the modules expect. - var skipGenesisInvariants = cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) - - // NOTE: Any module instantiated in the module manager that is later modified - // must be passed by reference here. - app.mm = module.NewManager( - genutil.NewAppModule( - app.AccountKeeper, - app.StakingKeeper, - app.BaseApp.DeliverTx, - encodingConfig.TxConfig, - ), - auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), - vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), - bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), - capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), - gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), - mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, minttypes.DefaultInflationCalculationFn, app.GetSubspace(minttypes.ModuleName)), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), - 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)), - upgrade.NewAppModule(app.UpgradeKeeper), - evidence.NewAppModule(app.EvidenceKeeper), - feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - params.NewAppModule(app.ParamsKeeper), - fundraising.NewAppModule(appCodec, app.FundraisingKeeper, app.AccountKeeper, app.BankKeeper, app.DistrKeeper), - authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), // always be last to make sure that it checks for all invariants and not only part of them - ) + // add to default baseapp options + // enable optimistic execution + baseAppOptions = append(baseAppOptions, baseapp.SetOptimisticExecution()) - // 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.mm.SetOrderBeginBlockers( - // upgrades should be run first - upgradetypes.ModuleName, - capabilitytypes.ModuleName, - crisistypes.ModuleName, - govtypes.ModuleName, - stakingtypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - distrtypes.ModuleName, - slashingtypes.ModuleName, - minttypes.ModuleName, - genutiltypes.ModuleName, - evidencetypes.ModuleName, - authz.ModuleName, - feegrant.ModuleName, - paramstypes.ModuleName, - vestingtypes.ModuleName, - fundraisingtypes.ModuleName, - consensusparamtypes.ModuleName, - ) + // build app + app.App = appBuilder.Build(db, traceStore, baseAppOptions...) - app.mm.SetOrderEndBlockers( - crisistypes.ModuleName, - govtypes.ModuleName, - stakingtypes.ModuleName, - feegrant.ModuleName, - authz.ModuleName, - capabilitytypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - distrtypes.ModuleName, - slashingtypes.ModuleName, - minttypes.ModuleName, - genutiltypes.ModuleName, - evidencetypes.ModuleName, - paramstypes.ModuleName, - upgradetypes.ModuleName, - vestingtypes.ModuleName, - fundraisingtypes.ModuleName, - consensusparamtypes.ModuleName, - ) + // register legacy modules + if err := app.registerIBCModules(appOpts); err != nil { + return nil, err + } - // NOTE: The genutils module must occur after staking so that pools are - // properly initialized with tokens from genesis accounts. - // NOTE: Capability module must occur first so that it can initialize any capabilities - // so that other modules that want to create or claim capabilities afterwards in InitChain - // can do so safely. - app.mm.SetOrderInitGenesis( - capabilitytypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - distrtypes.ModuleName, - stakingtypes.ModuleName, - slashingtypes.ModuleName, - govtypes.ModuleName, - minttypes.ModuleName, - crisistypes.ModuleName, - genutiltypes.ModuleName, - evidencetypes.ModuleName, - authz.ModuleName, - feegrant.ModuleName, - paramstypes.ModuleName, - upgradetypes.ModuleName, - vestingtypes.ModuleName, - fundraisingtypes.ModuleName, - consensusparamtypes.ModuleName, - ) + // register streaming services + if err := app.RegisterStreamingServices(appOpts, app.kvStoreKeys()); err != nil { + return nil, err + } - app.mm.RegisterInvariants(app.CrisisKeeper) - app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) - app.mm.RegisterServices(app.configurator) + /**** Module Options ****/ - autocliv1.RegisterQueryServer(app.GRPCQueryRouter(), runtimeservices.NewAutoCLIQueryService(app.mm.Modules)) - reflectionSvc, err := runtimeservices.NewReflectionService() - if err != nil { - panic(err) - } - reflectionv1.RegisterReflectionServiceServer(app.GRPCQueryRouter(), reflectionSvc) + app.ModuleManager.RegisterInvariants(app.CrisisKeeper) // create the simulation manager and define the order of the modules for deterministic simulations 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, app.GetSubspace(authtypes.ModuleName)), } - app.sm = module.NewSimulationManagerFromAppModules(app.mm.Modules, overrideModules) + app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, overrideModules) app.sm.RegisterStoreDecoders() - // initialize stores - app.MountKVStores(keys) - app.MountTransientStores(tkeys) - app.MountMemoryStores(memKeys) - - // initialize BaseApp - anteHandler, err := ante.NewAnteHandler( - ante.HandlerOptions{ - AccountKeeper: app.AccountKeeper, - BankKeeper: app.BankKeeper, - SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), - FeegrantKeeper: app.FeeGrantKeeper, - SigGasConsumer: ante.DefaultSigVerificationGasConsumer, - }, - ) - if err != nil { - panic(err) - } - - app.SetInitChainer(app.InitChainer) - app.SetBeginBlocker(app.BeginBlocker) - app.SetAnteHandler(anteHandler) - app.SetEndBlocker(app.EndBlocker) - - if loadLatest { - if err := app.LoadLatestVersion(); err != nil { - tmos.Exit(err.Error()) + // A custom InitChainer sets if extra pre-init-genesis logic is required. + // This is necessary for manually registered modules that do not support app wiring. + // Manually set the module version map as shown below. + // The upgrade module will automatically handle de-duplication of the module version map. + app.SetInitChainer(func(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { + if err := app.UpgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap()); err != nil { + return nil, err } - } - - return app -} + return app.App.InitChainer(ctx, req) + }) -// Name returns the name of the App -func (app *App) Name() string { return app.BaseApp.Name() } - -// GetBaseApp returns the base app of the application -func (app App) GetBaseApp() *baseapp.BaseApp { return app.BaseApp } - -// BeginBlocker application updates every begin block -func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { - return app.mm.BeginBlock(ctx, req) -} - -// EndBlocker application updates every end block -func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { - return app.mm.EndBlock(ctx, req) -} - -// InitChainer application update at chain initialization -func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { - var genesisState GenesisState - if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil { - panic(err) + if err := app.Load(loadLatest); err != nil { + return nil, err } - app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) - return app.mm.InitGenesis(ctx, app.appCodec, genesisState) -} - -// Configurator get app configurator -func (app *App) Configurator() module.Configurator { - return app.configurator -} -// LoadHeight loads a particular height -func (app *App) LoadHeight(height int64) error { - return app.LoadVersion(height) + return app, nil } -// RegisterNodeService implements the Application.RegisterNodeService method. -func (app *App) RegisterNodeService(clientCtx client.Context) { - nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) -} - -// ModuleAccountAddrs returns all the app's module account addresses. -func (app *App) ModuleAccountAddrs() map[string]bool { - modAccAddrs := make(map[string]bool) - for acc := range maccPerms { - modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true - } - - return modAccAddrs -} - -// BlockedModuleAccountAddrs returns all the app's blocked module account -// addresses. -func (app *App) BlockedModuleAccountAddrs() map[string]bool { - modAccAddrs := app.ModuleAccountAddrs() - delete(modAccAddrs, authtypes.NewModuleAddress(govtypes.ModuleName).String()) - - return modAccAddrs -} - -// LegacyAmino returns SimApp's amino codec. +// LegacyAmino returns App's amino codec. // // NOTE: This is solely to be used for testing purposes as it may be desirable // for modules to register their own custom testing types. @@ -646,7 +300,7 @@ func (app *App) LegacyAmino() *codec.LegacyAmino { return app.legacyAmino } -// AppCodec returns Gaia's app codec. +// AppCodec returns App's app codec. // // NOTE: This is solely to be used for testing purposes as it may be desirable // for modules to register their own custom testing types. @@ -654,89 +308,56 @@ func (app *App) AppCodec() codec.Codec { return app.appCodec } -// InterfaceRegistry returns Gaia's InterfaceRegistry -func (app *App) InterfaceRegistry() types.InterfaceRegistry { - return app.interfaceRegistry -} - // GetKey returns the KVStoreKey for the provided store key. -// -// NOTE: This is solely to be used for testing purposes. func (app *App) GetKey(storeKey string) *storetypes.KVStoreKey { - return app.keys[storeKey] + kvStoreKey, ok := app.UnsafeFindStoreKey(storeKey).(*storetypes.KVStoreKey) + if !ok { + return nil + } + return kvStoreKey } -// GetTKey returns the TransientStoreKey for the provided store key. -// -// NOTE: This is solely to be used for testing purposes. -func (app *App) GetTKey(storeKey string) *storetypes.TransientStoreKey { - return app.tkeys[storeKey] +// GetMemKey returns the MemoryStoreKey for the provided store key. +func (app *App) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { + key, ok := app.UnsafeFindStoreKey(storeKey).(*storetypes.MemoryStoreKey) + if !ok { + return nil + } + + return key } -// GetMemKey returns the MemStoreKey for the provided mem key. -// -// NOTE: This is solely used for testing purposes. -func (app *App) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { - return app.memKeys[storeKey] +// kvStoreKeys returns all the kv store keys registered inside App. +func (app *App) kvStoreKeys() map[string]*storetypes.KVStoreKey { + keys := make(map[string]*storetypes.KVStoreKey) + for _, k := range app.GetStoreKeys() { + if kv, ok := k.(*storetypes.KVStoreKey); ok { + keys[kv.Name()] = kv + } + } + + return keys } // GetSubspace returns a param subspace for a given module name. -// -// NOTE: This is solely to be used for testing purposes. func (app *App) GetSubspace(moduleName string) paramstypes.Subspace { subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) return subspace } -// RegisterAPIRoutes registers all application module routes with the provided -// API server. -func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { - clientCtx := apiSvr.ClientCtx - - // Register new tx routes from grpc-gateway. - authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - - // Register new tendermint queries routes from grpc-gateway. - tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - - // Register node gRPC service for grpc-gateway. - nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - - // Register grpc-gateway routes for all modules. - ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) +// GetIBCKeeper returns the IBC keeper. +func (app *App) GetIBCKeeper() *ibckeeper.Keeper { + return app.IBCKeeper } -// RegisterTxService implements the Application.RegisterTxService method. -func (app *App) RegisterTxService(clientCtx client.Context) { - authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) -} - -// RegisterTendermintService implements the Application.RegisterTendermintService method. -func (app *App) RegisterTendermintService(clientCtx client.Context) { - tmservice.RegisterTendermintService( - clientCtx, - app.BaseApp.GRPCQueryRouter(), - app.interfaceRegistry, - app.Query, - ) -} - -// 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).WithKeyTable(govv1.ParamKeyTable()) - paramsKeeper.Subspace(crisistypes.ModuleName) - paramsKeeper.Subspace(fundraisingtypes.ModuleName) - paramsKeeper.Subspace(consensusparamtypes.ModuleName) - - return paramsKeeper +// GetCapabilityScopedKeeper returns the capability scoped keeper. +func (app *App) GetCapabilityScopedKeeper(moduleName string) capabilitykeeper.ScopedKeeper { + sk, ok := app.ScopedKeepers[moduleName] + if !ok { + sk = app.CapabilityKeeper.ScopeToModule(moduleName) + app.ScopedKeepers[moduleName] = sk + } + return sk } // SimulationManager implements the SimulationApp interface. @@ -744,14 +365,41 @@ func (app *App) SimulationManager() *module.SimulationManager { return app.sm } -// InitGenesis performs init genesis functionality for modules. Exactly one -// module must return a non-empty validator set update to correctly initialize -// the chain. -func (app *App) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, genesisData map[string]json.RawMessage) { - app.mm.InitGenesis(ctx, cdc, genesisData) +// RegisterAPIRoutes registers all application module routes with the provided +// API server. +func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { + app.App.RegisterAPIRoutes(apiSvr, apiConfig) + // register swagger API in app.go so that other applications can override easily + if err := server.RegisterSwaggerAPI(apiSvr.ClientCtx, apiSvr.Router, apiConfig.Swagger); err != nil { + panic(err) + } + + // register app's OpenAPI routes. + docs.RegisterOpenAPIService(Name, apiSvr.Router) } -// TxConfig returns App's TxConfig -func (app *App) TxConfig() client.TxConfig { - return app.txConfig +// GetMaccPerms returns a copy of the module account permissions +// +// NOTE: This is solely to be used for testing purposes. +func GetMaccPerms() map[string][]string { + dup := make(map[string][]string) + for _, perms := range moduleAccPerms { + dup[perms.Account] = perms.Permissions + } + return dup +} + +// BlockedAddresses returns all the app's blocked account addresses. +func BlockedAddresses() map[string]bool { + result := make(map[string]bool) + if len(blockAccAddrs) > 0 { + for _, addr := range blockAccAddrs { + result[addr] = true + } + } else { + for addr := range GetMaccPerms() { + result[addr] = true + } + } + return result } diff --git a/app/app_config.go b/app/app_config.go new file mode 100644 index 00000000..dcbe6b1e --- /dev/null +++ b/app/app_config.go @@ -0,0 +1,303 @@ +package app + +import ( + "time" + + runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1" + appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" + authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" + authzmodulev1 "cosmossdk.io/api/cosmos/authz/module/v1" + 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" + evidencemodulev1 "cosmossdk.io/api/cosmos/evidence/module/v1" + feegrantmodulev1 "cosmossdk.io/api/cosmos/feegrant/module/v1" + genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" + govmodulev1 "cosmossdk.io/api/cosmos/gov/module/v1" + 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/core/appconfig" + circuittypes "cosmossdk.io/x/circuit/types" + evidencetypes "cosmossdk.io/x/evidence/types" + "cosmossdk.io/x/feegrant" + "cosmossdk.io/x/nft" + upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/cosmos/cosmos-sdk/runtime" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + "github.com/cosmos/cosmos-sdk/x/authz" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" + crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/group" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" + ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" + "google.golang.org/protobuf/types/known/durationpb" + + // NOTE: The genutils module must occur after staking so that pools are + // 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. + // NOTE: Capability module must occur first so that it can initialize any capabilities + // so that other modules that want to create or claim capabilities afterwards in InitChain + // can do so safely. + fundraisingmodulev1 "github.com/tendermint/fundraising/api/fundraising/fundraising/module/v1" + _ "github.com/tendermint/fundraising/x/fundraising/module" + fundraisingmoduletypes "github.com/tendermint/fundraising/x/fundraising/types" +) + +var ( + genesisModuleOrder = []string{ + // cosmos-sdk/ibc modules + capabilitytypes.ModuleName, + authtypes.ModuleName, + banktypes.ModuleName, + distrtypes.ModuleName, + stakingtypes.ModuleName, + slashingtypes.ModuleName, + govtypes.ModuleName, + minttypes.ModuleName, + crisistypes.ModuleName, + ibcexported.ModuleName, + genutiltypes.ModuleName, + evidencetypes.ModuleName, + authz.ModuleName, + ibctransfertypes.ModuleName, + icatypes.ModuleName, + ibcfeetypes.ModuleName, + feegrant.ModuleName, + paramstypes.ModuleName, + upgradetypes.ModuleName, + vestingtypes.ModuleName, + nft.ModuleName, + group.ModuleName, + consensustypes.ModuleName, + circuittypes.ModuleName, + // chain modules + fundraisingmoduletypes.ModuleName, + // this line is used by starport scaffolding # stargate/app/initGenesis + } + + // 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 + // NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC) + beginBlockers = []string{ + // cosmos sdk modules + minttypes.ModuleName, + distrtypes.ModuleName, + slashingtypes.ModuleName, + evidencetypes.ModuleName, + stakingtypes.ModuleName, + authz.ModuleName, + genutiltypes.ModuleName, + // ibc modules + capabilitytypes.ModuleName, + ibcexported.ModuleName, + ibctransfertypes.ModuleName, + icatypes.ModuleName, + ibcfeetypes.ModuleName, + // chain modules + fundraisingmoduletypes.ModuleName, + // this line is used by starport scaffolding # stargate/app/beginBlockers + } + + endBlockers = []string{ + // cosmos sdk modules + crisistypes.ModuleName, + govtypes.ModuleName, + stakingtypes.ModuleName, + feegrant.ModuleName, + group.ModuleName, + genutiltypes.ModuleName, + // ibc modules + ibcexported.ModuleName, + ibctransfertypes.ModuleName, + capabilitytypes.ModuleName, + icatypes.ModuleName, + ibcfeetypes.ModuleName, + // chain modules + fundraisingmoduletypes.ModuleName, + // this line is used by starport scaffolding # stargate/app/endBlockers + } + + preBlockers = []string{ + upgradetypes.ModuleName, + // this line is used by starport scaffolding # stargate/app/preBlockers + } + + // module account permissions + moduleAccPerms = []*authmodulev1.ModuleAccountPermission{ + {Account: authtypes.FeeCollectorName}, + {Account: distrtypes.ModuleName}, + {Account: minttypes.ModuleName, Permissions: []string{authtypes.Minter}}, + {Account: stakingtypes.BondedPoolName, Permissions: []string{authtypes.Burner, stakingtypes.ModuleName}}, + {Account: stakingtypes.NotBondedPoolName, Permissions: []string{authtypes.Burner, stakingtypes.ModuleName}}, + {Account: govtypes.ModuleName, Permissions: []string{authtypes.Burner}}, + {Account: nft.ModuleName}, + {Account: ibctransfertypes.ModuleName, Permissions: []string{authtypes.Minter, authtypes.Burner}}, + {Account: ibcfeetypes.ModuleName}, + {Account: icatypes.ModuleName}, + {Account: fundraisingmoduletypes.ModuleName, Permissions: []string{authtypes.Minter, authtypes.Burner, authtypes.Staking}}, + // this line is used by starport scaffolding # stargate/app/maccPerms + } + + // blocked account addresses + blockAccAddrs = []string{ + authtypes.FeeCollectorName, + distrtypes.ModuleName, + minttypes.ModuleName, + stakingtypes.BondedPoolName, + stakingtypes.NotBondedPoolName, + nft.ModuleName, + // We allow the following module accounts to receive funds: + // govtypes.ModuleName + } + + // appConfig application configuration (used by depinject) + appConfig = appconfig.Compose(&appv1alpha1.Config{ + Modules: []*appv1alpha1.ModuleConfig{ + { + Name: runtime.ModuleName, + Config: appconfig.WrapAny(&runtimev1alpha1.Module{ + AppName: Name, + PreBlockers: preBlockers, + BeginBlockers: beginBlockers, + EndBlockers: endBlockers, + InitGenesis: genesisModuleOrder, + OverrideStoreKeys: []*runtimev1alpha1.StoreKeyConfig{ + { + ModuleName: authtypes.ModuleName, + KvStoreKey: "acc", + }, + }, + // When ExportGenesis is not specified, the export genesis module order + // is equal to the init genesis order + // ExportGenesis: genesisModuleOrder, + // Uncomment if you want to set a custom migration order here. + // OrderMigrations: nil, + }), + }, + { + Name: authtypes.ModuleName, + Config: appconfig.WrapAny(&authmodulev1.Module{ + Bech32Prefix: AccountAddressPrefix, + ModuleAccountPermissions: moduleAccPerms, + // By default modules authority is the governance module. This is configurable with the following: + // Authority: "group", // A custom module authority can be set using a module name + // Authority: "cosmos1cwwv22j5ca08ggdv9c2uky355k908694z577tv", // or a specific address + }), + }, + { + Name: nft.ModuleName, + Config: appconfig.WrapAny(&nftmodulev1.Module{}), + }, + { + Name: vestingtypes.ModuleName, + Config: appconfig.WrapAny(&vestingmodulev1.Module{}), + }, + { + Name: banktypes.ModuleName, + Config: appconfig.WrapAny(&bankmodulev1.Module{ + BlockedModuleAccountsOverride: blockAccAddrs, + }), + }, + { + 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: AccountAddressPrefix + "valoper", + Bech32PrefixConsensus: AccountAddressPrefix + "valcons", + }), + }, + { + Name: slashingtypes.ModuleName, + Config: appconfig.WrapAny(&slashingmodulev1.Module{}), + }, + { + Name: paramstypes.ModuleName, + Config: appconfig.WrapAny(¶msmodulev1.Module{}), + }, + { + Name: "tx", + Config: appconfig.WrapAny(&txconfigv1.Config{}), + }, + { + Name: genutiltypes.ModuleName, + Config: appconfig.WrapAny(&genutilmodulev1.Module{}), + }, + { + Name: authz.ModuleName, + Config: appconfig.WrapAny(&authzmodulev1.Module{}), + }, + { + Name: upgradetypes.ModuleName, + Config: appconfig.WrapAny(&upgrademodulev1.Module{}), + }, + { + Name: distrtypes.ModuleName, + Config: appconfig.WrapAny(&distrmodulev1.Module{}), + }, + { + Name: evidencetypes.ModuleName, + Config: appconfig.WrapAny(&evidencemodulev1.Module{}), + }, + { + Name: minttypes.ModuleName, + Config: appconfig.WrapAny(&mintmodulev1.Module{}), + }, + { + Name: group.ModuleName, + Config: appconfig.WrapAny(&groupmodulev1.Module{ + MaxExecutionPeriod: durationpb.New(time.Second * 1209600), + MaxMetadataLen: 255, + }), + }, + { + Name: feegrant.ModuleName, + Config: appconfig.WrapAny(&feegrantmodulev1.Module{}), + }, + { + Name: govtypes.ModuleName, + Config: appconfig.WrapAny(&govmodulev1.Module{}), + }, + { + Name: crisistypes.ModuleName, + Config: appconfig.WrapAny(&crisismodulev1.Module{}), + }, + { + Name: consensustypes.ModuleName, + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), + }, + { + Name: circuittypes.ModuleName, + Config: appconfig.WrapAny(&circuitmodulev1.Module{}), + }, + { + Name: fundraisingmoduletypes.ModuleName, + Config: appconfig.WrapAny(&fundraisingmodulev1.Module{}), + }, + // this line is used by starport scaffolding # stargate/app/moduleConfig + }, + }) +) diff --git a/app/config.go b/app/config.go new file mode 100644 index 00000000..f8860c87 --- /dev/null +++ b/app/config.go @@ -0,0 +1,19 @@ +package app + +import sdk "github.com/cosmos/cosmos-sdk/types" + +func init() { + // Set prefixes + accountPubKeyPrefix := AccountAddressPrefix + "pub" + validatorAddressPrefix := AccountAddressPrefix + "valoper" + validatorPubKeyPrefix := AccountAddressPrefix + "valoperpub" + consNodeAddressPrefix := AccountAddressPrefix + "valcons" + consNodePubKeyPrefix := AccountAddressPrefix + "valconspub" + + // Set and seal config + config := sdk.GetConfig() + config.SetBech32PrefixForAccount(AccountAddressPrefix, accountPubKeyPrefix) + config.SetBech32PrefixForValidator(validatorAddressPrefix, validatorPubKeyPrefix) + config.SetBech32PrefixForConsensusNode(consNodeAddressPrefix, consNodePubKeyPrefix) + config.Seal() +} diff --git a/app/export.go b/app/export.go index 5f3661a4..2b1771cd 100644 --- a/app/export.go +++ b/app/export.go @@ -1,13 +1,12 @@ package app -// DONTCOVER - import ( "encoding/json" "fmt" "log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + storetypes "cosmossdk.io/store/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" @@ -17,23 +16,23 @@ import ( // ExportAppStateAndValidators exports the state of the application for a genesis // file. -func (app *App) ExportAppStateAndValidators( - forZeroHeight bool, - jailAllowedAddrs []string, - modulesToExport []string, -) (servertypes.ExportedApp, error) { +func (app *App) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs, modulesToExport []string) (servertypes.ExportedApp, error) { // as if they could withdraw from the start of the next block - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) + ctx := app.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight()}) // We export at last height + 1, because that's the height at which - // Tendermint will start InitChain. + // CometBFT will start InitChain. height := app.LastBlockHeight() + 1 if forZeroHeight { height = 0 app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) } - genState := app.mm.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) + genState, err := app.ModuleManager.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) + if err != nil { + return servertypes.ExportedApp{}, err + } + appState, err := json.MarshalIndent(genState, "", " ") if err != nil { return servertypes.ExportedApp{}, err @@ -48,10 +47,10 @@ func (app *App) ExportAppStateAndValidators( }, err } -// prepForZeroHeightGenesis prepares for a fresh genesis -// +// prepare for fresh start at zero height // NOTE zero height genesis is a temporary feature which will be deprecated -// in favour of export at a block height +// +// in favor of export at a block height func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) { applyAllowedAddrs := false @@ -76,13 +75,24 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str /* 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 { @@ -105,14 +115,26 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str 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 := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) - feePool := app.DistrKeeper.GetFeePool(ctx) + scraps, err := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, valBz) + if err != nil { + panic(err) + } + feePool, err := app.DistrKeeper.FeePool.Get(ctx) + if err != nil { + panic(err) + } feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) - app.DistrKeeper.SetFeePool(ctx, feePool) + if err := app.DistrKeeper.FeePool.Set(ctx, feePool); err != nil { + 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 @@ -143,33 +165,45 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str /* Handle staking state. */ // iterate through redelegations, reset creation height - app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { + err = app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { 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 }) + if err != nil { + panic(err) + } // iterate through unbonding delegations, reset creation height - app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) { + err = app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) { 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 }) + if err != nil { + panic(err) + } // Iterate through validators by power descending, reset bond heights, and // update bond intra-tx counters. store := ctx.KVStore(app.GetKey(stakingtypes.StoreKey)) - iter := sdk.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) + iter := storetypes.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) counter := int16(0) 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") } @@ -178,7 +212,9 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str validator.Jailed = true } - app.StakingKeeper.SetValidator(ctx, validator) + if err := app.StakingKeeper.SetValidator(ctx, validator); err != nil { + panic(err) + } counter++ } @@ -187,7 +223,7 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str return } - _, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + _, err = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) if err != nil { log.Fatal(err) } @@ -195,12 +231,14 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str /* Handle slashing state. */ // reset start height on signing infos - app.SlashingKeeper.IterateValidatorSigningInfos( + if err := app.SlashingKeeper.IterateValidatorSigningInfos( ctx, func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { info.StartHeight = 0 - app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info) + _ = app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info) return false }, - ) + ); err != nil { + log.Fatal(err) + } } diff --git a/app/genesis.go b/app/genesis.go index b5feb14c..e4e849fc 100644 --- a/app/genesis.go +++ b/app/genesis.go @@ -1,14 +1,10 @@ package app -// DONTCOVER - import ( "encoding/json" - - "github.com/cosmos/cosmos-sdk/codec" ) -// The genesis state of the blockchain is represented here as a map of raw json +// GenesisState of the blockchain is represented here as a map of raw json // messages key'd by a identifier string. // The identifier is used to determine which module genesis information belongs // to so it may be appropriately routed during init chain. @@ -16,8 +12,3 @@ import ( // the ModuleBasicManager which populates json from each BasicModule // object provided to it during init. type GenesisState map[string]json.RawMessage - -// NewDefaultGenesisState generates the default state for the application. -func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState { - return ModuleBasics.DefaultGenesis(cdc) -} diff --git a/app/genesis_account.go b/app/genesis_account.go new file mode 100644 index 00000000..91ff4dfc --- /dev/null +++ b/app/genesis_account.go @@ -0,0 +1,47 @@ +package app + +import ( + "errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +var _ authtypes.GenesisAccount = (*GenesisAccount)(nil) + +// GenesisAccount defines a type that implements the GenesisAccount interface +// to be used for simulation accounts in the genesis state. +type GenesisAccount struct { + *authtypes.BaseAccount + + // vesting account fields + OriginalVesting sdk.Coins `json:"original_vesting" yaml:"original_vesting"` // total vesting coins upon initialization + DelegatedFree sdk.Coins `json:"delegated_free" yaml:"delegated_free"` // delegated vested coins at time of delegation + DelegatedVesting sdk.Coins `json:"delegated_vesting" yaml:"delegated_vesting"` // delegated vesting coins at time of delegation + StartTime int64 `json:"start_time" yaml:"start_time"` // vesting start time (UNIX Epoch time) + EndTime int64 `json:"end_time" yaml:"end_time"` // vesting end time (UNIX Epoch time) + + // module account fields + ModuleName string `json:"module_name" yaml:"module_name"` // name of the module account + ModulePermissions []string `json:"module_permissions" yaml:"module_permissions"` // permissions of module account +} + +// Validate checks for errors on the vesting and module account parameters +func (sga GenesisAccount) Validate() error { + if !sga.OriginalVesting.IsZero() { + if sga.StartTime >= sga.EndTime { + return errors.New("vesting start-time cannot be before end-time") + } + } + + if sga.ModuleName != "" { + ma := authtypes.ModuleAccount{ + BaseAccount: sga.BaseAccount, Name: sga.ModuleName, Permissions: sga.ModulePermissions, + } + if err := ma.Validate(); err != nil { + return err + } + } + + return sga.BaseAccount.Validate() +} diff --git a/app/ibc.go b/app/ibc.go new file mode 100644 index 00000000..12f9575c --- /dev/null +++ b/app/ibc.go @@ -0,0 +1,206 @@ +package app + +import ( + "cosmossdk.io/core/appmodule" + storetypes "cosmossdk.io/store/types" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + "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" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/cosmos/ibc-go/modules/capability" + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + icamodule "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts" + icacontroller "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller" + icacontrollerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper" + icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" + icahost "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host" + icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper" + icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" + ibcfee "github.com/cosmos/ibc-go/v8/modules/apps/29-fee" + ibcfeekeeper "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/keeper" + ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" + ibctransfer "github.com/cosmos/ibc-go/v8/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v8/modules/core" + ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" // nolint:staticcheck // Deprecated: params key table is needed for params migration + ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" + solomachine "github.com/cosmos/ibc-go/v8/modules/light-clients/06-solomachine" + ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" +) + +// registerIBCModules register IBC keepers and non dependency inject modules. +func (app *App) registerIBCModules(appOpts servertypes.AppOptions) error { + // set up non depinject support modules store keys + if err := app.RegisterStores( + storetypes.NewKVStoreKey(capabilitytypes.StoreKey), + storetypes.NewKVStoreKey(ibcexported.StoreKey), + storetypes.NewKVStoreKey(ibctransfertypes.StoreKey), + storetypes.NewKVStoreKey(ibcfeetypes.StoreKey), + storetypes.NewKVStoreKey(icahosttypes.StoreKey), + storetypes.NewKVStoreKey(icacontrollertypes.StoreKey), + storetypes.NewMemoryStoreKey(capabilitytypes.MemStoreKey), + storetypes.NewTransientStoreKey(paramstypes.TStoreKey), + ); err != nil { + return err + } + + // register the key tables for legacy param subspaces + keyTable := ibcclienttypes.ParamKeyTable() + keyTable.RegisterParamSet(&ibcconnectiontypes.Params{}) + app.ParamsKeeper.Subspace(ibcexported.ModuleName).WithKeyTable(keyTable) + app.ParamsKeeper.Subspace(ibctransfertypes.ModuleName).WithKeyTable(ibctransfertypes.ParamKeyTable()) + app.ParamsKeeper.Subspace(icacontrollertypes.SubModuleName).WithKeyTable(icacontrollertypes.ParamKeyTable()) + app.ParamsKeeper.Subspace(icahosttypes.SubModuleName).WithKeyTable(icahosttypes.ParamKeyTable()) + + // add capability keeper and ScopeToModule for ibc module + app.CapabilityKeeper = capabilitykeeper.NewKeeper( + app.AppCodec(), + app.GetKey(capabilitytypes.StoreKey), + app.GetMemKey(capabilitytypes.MemStoreKey), + ) + + // add capability keeper and ScopeToModule for ibc module + scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibcexported.ModuleName) + scopedIBCTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) + scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName) + scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) + + // Create IBC keeper + app.IBCKeeper = ibckeeper.NewKeeper( + app.appCodec, + app.GetKey(ibcexported.StoreKey), + app.GetSubspace(ibcexported.ModuleName), + app.StakingKeeper, + app.UpgradeKeeper, + scopedIBCKeeper, + 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) + + app.IBCFeeKeeper = ibcfeekeeper.NewKeeper( + app.appCodec, app.GetKey(ibcfeetypes.StoreKey), + app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware + app.IBCKeeper.ChannelKeeper, + app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, + ) + + // Create IBC transfer keeper + app.TransferKeeper = ibctransferkeeper.NewKeeper( + app.appCodec, + app.GetKey(ibctransfertypes.StoreKey), + app.GetSubspace(ibctransfertypes.ModuleName), + app.IBCFeeKeeper, + app.IBCKeeper.ChannelKeeper, + app.IBCKeeper.PortKeeper, + app.AccountKeeper, + app.BankKeeper, + scopedIBCTransferKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + // Create interchain account keepers + app.ICAHostKeeper = icahostkeeper.NewKeeper( + app.appCodec, + app.GetKey(icahosttypes.StoreKey), + app.GetSubspace(icahosttypes.SubModuleName), + app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack + app.IBCKeeper.ChannelKeeper, + app.IBCKeeper.PortKeeper, + app.AccountKeeper, + scopedICAHostKeeper, + app.MsgServiceRouter(), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + app.ICAHostKeeper.WithQueryRouter(app.GRPCQueryRouter()) + + app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( + app.appCodec, + app.GetKey(icacontrollertypes.StoreKey), + app.GetSubspace(icacontrollertypes.SubModuleName), + app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack + app.IBCKeeper.ChannelKeeper, + app.IBCKeeper.PortKeeper, + scopedICAControllerKeeper, + app.MsgServiceRouter(), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + app.GovKeeper.SetLegacyRouter(govRouter) + + // Create IBC modules with ibcfee middleware + transferIBCModule := ibcfee.NewIBCMiddleware(ibctransfer.NewIBCModule(app.TransferKeeper), app.IBCFeeKeeper) + + // integration point for custom authentication modules + var noAuthzModule porttypes.IBCModule + icaControllerIBCModule := ibcfee.NewIBCMiddleware( + icacontroller.NewIBCMiddleware(noAuthzModule, app.ICAControllerKeeper), + app.IBCFeeKeeper, + ) + + icaHostIBCModule := ibcfee.NewIBCMiddleware(icahost.NewIBCModule(app.ICAHostKeeper), app.IBCFeeKeeper) + + // Create static IBC router, add transfer route, then set and seal it + ibcRouter := porttypes.NewRouter(). + AddRoute(ibctransfertypes.ModuleName, transferIBCModule). + AddRoute(icacontrollertypes.SubModuleName, icaControllerIBCModule). + AddRoute(icahosttypes.SubModuleName, icaHostIBCModule) + + // this line is used by starport scaffolding # ibc/app/module + + app.IBCKeeper.SetRouter(ibcRouter) + + app.ScopedIBCKeeper = scopedIBCKeeper + app.ScopedIBCTransferKeeper = scopedIBCTransferKeeper + app.ScopedICAHostKeeper = scopedICAHostKeeper + app.ScopedICAControllerKeeper = scopedICAControllerKeeper + + // register IBC modules + if err := app.RegisterModules( + ibc.NewAppModule(app.IBCKeeper), + ibctransfer.NewAppModule(app.TransferKeeper), + ibcfee.NewAppModule(app.IBCFeeKeeper), + icamodule.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper), + capability.NewAppModule(app.appCodec, *app.CapabilityKeeper, false), + ibctm.NewAppModule(), + solomachine.NewAppModule(), + ); err != nil { + return err + } + + return nil +} + +// RegisterIBC Since the IBC modules don't support dependency injection, +// we need to manually register the modules on the client side. +// This needs to be removed after IBC supports App Wiring. +func RegisterIBC(registry cdctypes.InterfaceRegistry) map[string]appmodule.AppModule { + modules := map[string]appmodule.AppModule{ + ibcexported.ModuleName: ibc.AppModule{}, + ibctransfertypes.ModuleName: ibctransfer.AppModule{}, + ibcfeetypes.ModuleName: ibcfee.AppModule{}, + icatypes.ModuleName: icamodule.AppModule{}, + capabilitytypes.ModuleName: capability.AppModule{}, + ibctm.ModuleName: ibctm.AppModule{}, + solomachine.ModuleName: solomachine.AppModule{}, + } + + for name, m := range modules { + module.CoreAppModuleBasicAdaptor(name, m).RegisterInterfaces(registry) + } + + return modules +} diff --git a/app/params/weights.go b/app/params/weights.go deleted file mode 100644 index 332d8fb4..00000000 --- a/app/params/weights.go +++ /dev/null @@ -1,9 +0,0 @@ -package params - -// Default simulation operation weights for messages and gov proposals. -const ( - DefaultWeightMsgCreateFixedPriceAuction int = 20 - DefaultWeightMsgCreateBatchAuction int = 20 - DefaultWeightMsgCancelAuction int = 15 - DefaultWeightMsgPlaceBid int = 80 -) diff --git a/app/sim_bench_test.go b/app/sim_bench_test.go new file mode 100644 index 00000000..47317f86 --- /dev/null +++ b/app/sim_bench_test.go @@ -0,0 +1,150 @@ +package app_test + +import ( + "fmt" + "os" + "testing" + + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/server" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" + "github.com/stretchr/testify/require" + + "github.com/tendermint/fundraising/app" +) + +// Profile with: +// `go test -benchmem -run=^$ -bench ^BenchmarkFullAppSimulation ./app -Commit=true -cpuprofile cpu.out` +func BenchmarkFullAppSimulation(b *testing.B) { + b.ReportAllocs() + + config := simcli.NewConfigFromFlags() + config.ChainID = SimAppChainID + + db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "goleveldb-app-sim", "Simulation", simcli.FlagVerboseValue, simcli.FlagEnabledValue) + if err != nil { + b.Fatalf("simulation setup failed: %s", err.Error()) + } + + if skip { + b.Skip("skipping benchmark application simulation") + } + + defer func() { + require.NoError(b, db.Close()) + require.NoError(b, os.RemoveAll(dir)) + }() + + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[flags.FlagHome] = app.DefaultNodeHome + appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + + bApp, err := app.New(logger, db, nil, true, appOptions, interBlockCacheOpt()) + require.NoError(b, err) + require.Equal(b, app.Name, bApp.Name()) + + // run randomized simulation + _, simParams, simErr := simulation.SimulateFromSeed( + b, + os.Stdout, + bApp.BaseApp, + simtestutil.AppStateFn(bApp.AppCodec(), bApp.SimulationManager(), bApp.DefaultGenesis()), + simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 + simtestutil.SimulationOperations(bApp, bApp.AppCodec(), config), + app.BlockedAddresses(), + config, + bApp.AppCodec(), + ) + + // export state and simParams before the simulation error is checked + if err = simtestutil.CheckExportSimulation(bApp, config, simParams); err != nil { + b.Fatal(err) + } + + if simErr != nil { + b.Fatal(simErr) + } + + if config.Commit { + simtestutil.PrintStats(db) + } +} + +func BenchmarkInvariants(b *testing.B) { + b.ReportAllocs() + + config := simcli.NewConfigFromFlags() + config.ChainID = SimAppChainID + + db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "leveldb-app-invariant-bench", "Simulation", simcli.FlagVerboseValue, simcli.FlagEnabledValue) + if err != nil { + b.Fatalf("simulation setup failed: %s", err.Error()) + } + + if skip { + b.Skip("skipping benchmark application simulation") + } + + config.AllInvariants = false + + defer func() { + require.NoError(b, db.Close()) + require.NoError(b, os.RemoveAll(dir)) + }() + + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[flags.FlagHome] = app.DefaultNodeHome + appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + + bApp, err := app.New(logger, db, nil, true, appOptions, interBlockCacheOpt()) + require.NoError(b, err) + require.Equal(b, app.Name, bApp.Name()) + + // run randomized simulation + _, simParams, simErr := simulation.SimulateFromSeed( + b, + os.Stdout, + bApp.BaseApp, + simtestutil.AppStateFn(bApp.AppCodec(), bApp.SimulationManager(), bApp.DefaultGenesis()), + simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 + simtestutil.SimulationOperations(bApp, bApp.AppCodec(), config), + app.BlockedAddresses(), + config, + bApp.AppCodec(), + ) + + // export state and simParams before the simulation error is checked + if err = simtestutil.CheckExportSimulation(bApp, config, simParams); err != nil { + b.Fatal(err) + } + + if simErr != nil { + b.Fatal(simErr) + } + + if config.Commit { + simtestutil.PrintStats(db) + } + + ctx := bApp.NewContextLegacy(true, cmtproto.Header{Height: bApp.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 bApp.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/app/sim_test.go b/app/sim_test.go index a7d4afe5..e3f30449 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -1,9 +1,8 @@ package app_test -// DONTCOVER - import ( "encoding/json" + "flag" "fmt" "math/rand" "os" @@ -12,45 +11,39 @@ import ( "testing" "time" - dbm "github.com/cometbft/cometbft-db" + "cosmossdk.io/log" + "cosmossdk.io/store" + storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/feegrant" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/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/client/flags" "github.com/cosmos/cosmos-sdk/server" - storetypes "github.com/cosmos/cosmos-sdk/store/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + simulationtypes "github.com/cosmos/cosmos-sdk/types/simulation" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/cosmos/cosmos-sdk/x/simulation" simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/spf13/viper" "github.com/stretchr/testify/require" "github.com/tendermint/fundraising/app" - "github.com/tendermint/fundraising/cmd" - fundraisingtypes "github.com/tendermint/fundraising/x/fundraising/types" ) +const ( + SimAppChainID = "fundraising-simapp" +) + +var FlagEnableStreamingValue bool + +// Get flags every time the simulator is run func init() { simcli.GetSimulatorFlags() -} - -type StoreKeysPrefixes struct { - A storetypes.StoreKey - B storetypes.StoreKey - Prefixes [][]byte + flag.BoolVar(&FlagEnableStreamingValue, "EnableStreaming", false, "Enable streaming service") } // fauxMerkleModeOpt returns a BaseApp option to use a dbStoreAdapter instead of @@ -59,66 +52,54 @@ func fauxMerkleModeOpt(bapp *baseapp.BaseApp) { bapp.SetFauxMerkleMode() } +// interBlockCacheOpt returns a BaseApp option function that sets the persistent +// inter-block write-through cache. +func interBlockCacheOpt() func(*baseapp.BaseApp) { + return baseapp.SetInterBlockCache(store.NewCommitKVStoreCacheManager()) +} + // BenchmarkSimulation run the chain simulation // Running using starport command: -// `starport chain simulate -v --numBlocks 200 --blockSize 50` +// `ignite chain simulate -v --numBlocks 200 --blockSize 50` // Running as go benchmark test: // `go test -benchmem -run=^$ -bench ^BenchmarkSimulation ./app -NumBlocks=200 -BlockSize 50 -Commit=true -Verbose=true -Enabled=true` func BenchmarkSimulation(b *testing.B) { - simcli.FlagSeedValue = 10 + simcli.FlagSeedValue = time.Now().Unix() simcli.FlagVerboseValue = true simcli.FlagCommitValue = true simcli.FlagEnabledValue = true config := simcli.NewConfigFromFlags() - config.ChainID = app.DefaultChainID + config.ChainID = SimAppChainID - db, dir, logger, _, err := simtestutil.SetupSimulation( - config, - "leveldb-app-sim", - "Simulation", - simcli.FlagVerboseValue, - simcli.FlagEnabledValue, - ) + db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "leveldb-app-sim", "Simulation", simcli.FlagVerboseValue, simcli.FlagEnabledValue) + if skip { + b.Skip("skipping application simulation") + } require.NoError(b, err, "simulation setup failed") - b.Cleanup(func() { + defer func() { require.NoError(b, db.Close()) require.NoError(b, os.RemoveAll(dir)) - }) + }() appOptions := make(simtestutil.AppOptionsMap, 0) appOptions[flags.FlagHome] = app.DefaultNodeHome appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue - cmdApp := app.New( - logger, - db, - nil, - true, - map[int64]bool{}, - app.DefaultNodeHome, - 0, - cmd.MakeEncodingConfig(app.ModuleBasics), - appOptions, - baseapp.SetChainID(app.DefaultChainID), - ) - - bApp, ok := cmdApp.(*app.App) - require.True(b, ok) + bApp, err := app.New(logger, db, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID)) + require.NoError(b, err) + require.Equal(b, app.Name, bApp.Name()) - // Run randomized simulations + // run randomized simulation _, simParams, simErr := simulation.SimulateFromSeed( b, os.Stdout, - bApp.GetBaseApp(), - app.AppStateFn( - bApp.AppCodec(), - bApp.SimulationManager(), - ), - simtypes.RandomAccounts, + bApp.BaseApp, + simtestutil.AppStateFn(bApp.AppCodec(), bApp.SimulationManager(), bApp.DefaultGenesis()), + simulationtypes.RandomAccounts, simtestutil.SimulationOperations(bApp, bApp.AppCodec(), config), - bApp.BlockedModuleAccountAddrs(), + app.BlockedAddresses(), config, bApp.AppCodec(), ) @@ -135,15 +116,9 @@ func BenchmarkSimulation(b *testing.B) { func TestAppImportExport(t *testing.T) { config := simcli.NewConfigFromFlags() - config.ChainID = app.DefaultChainID + config.ChainID = SimAppChainID - db, dir, logger, skip, err := simtestutil.SetupSimulation( - config, - "leveldb-app-sim", - "Simulation", - simcli.FlagVerboseValue, - simcli.FlagEnabledValue, - ) + db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "leveldb-app-sim", "Simulation", simcli.FlagVerboseValue, simcli.FlagEnabledValue) if skip { t.Skip("skipping application import/export simulation") } @@ -158,42 +133,27 @@ func TestAppImportExport(t *testing.T) { appOptions[flags.FlagHome] = app.DefaultNodeHome appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue - cmdApp := app.New( - logger, - db, - nil, - true, - map[int64]bool{}, - app.DefaultNodeHome, - 0, - cmd.MakeEncodingConfig(app.ModuleBasics), - appOptions, - fauxMerkleModeOpt, - baseapp.SetChainID(app.DefaultChainID), - ) - bApp, ok := cmdApp.(*app.App) - require.True(t, ok) + bApp, err := app.New(logger, db, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID)) + require.NoError(t, err) + require.Equal(t, app.Name, bApp.Name()) - // run randomized simulation + // Run randomized simulation _, simParams, simErr := simulation.SimulateFromSeed( t, os.Stdout, - bApp.GetBaseApp(), - app.AppStateFn( - bApp.AppCodec(), - bApp.SimulationManager(), - ), - simtypes.RandomAccounts, + bApp.BaseApp, + simtestutil.AppStateFn(bApp.AppCodec(), bApp.SimulationManager(), bApp.DefaultGenesis()), + simulationtypes.RandomAccounts, simtestutil.SimulationOperations(bApp, bApp.AppCodec(), config), - bApp.BlockedModuleAccountAddrs(), + app.BlockedAddresses(), config, bApp.AppCodec(), ) - require.NoError(t, simErr) // export state and simParams before the simulation error is checked err = simtestutil.CheckExportSimulation(bApp, config, simParams) require.NoError(t, err) + require.NoError(t, simErr) if config.Commit { simtestutil.PrintStats(db) @@ -206,13 +166,7 @@ func TestAppImportExport(t *testing.T) { fmt.Printf("importing genesis...\n") - newDB, newDir, _, _, err := simtestutil.SetupSimulation( - config, - "leveldb-app-sim-2", - "Simulation-2", - simcli.FlagVerboseValue, - simcli.FlagEnabledValue, - ) + newDB, newDir, _, _, err := simtestutil.SetupSimulation(config, "leveldb-app-sim-2", "Simulation-2", simcli.FlagVerboseValue, simcli.FlagEnabledValue) require.NoError(t, err, "simulation setup failed") defer func() { @@ -220,89 +174,71 @@ func TestAppImportExport(t *testing.T) { require.NoError(t, os.RemoveAll(newDir)) }() - cmdNewApp := app.New( - log.NewNopLogger(), - newDB, - nil, - true, - map[int64]bool{}, - app.DefaultNodeHome, - 0, - cmd.MakeEncodingConfig(app.ModuleBasics), - appOptions, - fauxMerkleModeOpt, - baseapp.SetChainID(app.DefaultChainID), - ) - - newApp, ok := cmdNewApp.(*app.App) - require.True(t, ok) + newApp, err := app.New(log.NewNopLogger(), newDB, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID)) + require.NoError(t, err) + require.Equal(t, app.Name, newApp.Name()) var genesisState app.GenesisState 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 := bApp.NewContextLegacy(true, cmtproto.Header{Height: bApp.LastBlockHeight()}) + ctxB := newApp.NewContextLegacy(true, cmtproto.Header{Height: bApp.LastBlockHeight()}) + _, err = newApp.ModuleManager.InitGenesis(ctxB, bApp.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 := bApp.NewContext(true, tmproto.Header{Height: bApp.LastBlockHeight()}) - ctxB := newApp.NewContext(true, tmproto.Header{Height: bApp.LastBlockHeight()}) - newApp.InitGenesis(ctxB, bApp.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") - storeKeysPrefixes := []StoreKeysPrefixes{ - {bApp.GetKey(authtypes.StoreKey), newApp.GetKey(authtypes.StoreKey), [][]byte{}}, - { - bApp.GetKey(stakingtypes.StoreKey), newApp.GetKey(stakingtypes.StoreKey), - [][]byte{ - stakingtypes.UnbondingQueueKey, stakingtypes.RedelegationQueueKey, stakingtypes.ValidatorQueueKey, - stakingtypes.HistoricalInfoKey, stakingtypes.UnbondingIDKey, stakingtypes.UnbondingIndexKey, stakingtypes.UnbondingTypeKey, stakingtypes.ValidatorUpdatesKey, - }, - }, // ordering may change but it doesn't matter - {bApp.GetKey(slashingtypes.StoreKey), newApp.GetKey(slashingtypes.StoreKey), [][]byte{}}, - {bApp.GetKey(minttypes.StoreKey), newApp.GetKey(minttypes.StoreKey), [][]byte{}}, - {bApp.GetKey(distrtypes.StoreKey), newApp.GetKey(distrtypes.StoreKey), [][]byte{}}, - {bApp.GetKey(banktypes.StoreKey), newApp.GetKey(banktypes.StoreKey), [][]byte{banktypes.BalancesPrefix}}, - {bApp.GetKey(paramstypes.StoreKey), newApp.GetKey(paramstypes.StoreKey), [][]byte{}}, - {bApp.GetKey(govtypes.StoreKey), newApp.GetKey(govtypes.StoreKey), [][]byte{}}, - {bApp.GetKey(evidencetypes.StoreKey), newApp.GetKey(evidencetypes.StoreKey), [][]byte{}}, - {bApp.GetKey(capabilitytypes.StoreKey), newApp.GetKey(capabilitytypes.StoreKey), [][]byte{}}, - {bApp.GetKey(authzkeeper.StoreKey), newApp.GetKey(authzkeeper.StoreKey), [][]byte{authzkeeper.GrantKey, authzkeeper.GrantQueuePrefix}}, - {bApp.GetKey(fundraisingtypes.StoreKey), newApp.GetKey(fundraisingtypes.StoreKey), [][]byte{}}, + // skip certain prefixes + skipPrefixes := map[string][][]byte{ + stakingtypes.StoreKey: { + stakingtypes.UnbondingQueueKey, stakingtypes.RedelegationQueueKey, stakingtypes.ValidatorQueueKey, + stakingtypes.HistoricalInfoKey, stakingtypes.UnbondingIDKey, stakingtypes.UnbondingIndexKey, + stakingtypes.UnbondingTypeKey, stakingtypes.ValidatorUpdatesKey, + }, + authzkeeper.StoreKey: {authzkeeper.GrantQueuePrefix}, + feegrant.StoreKey: {feegrant.FeeAllowanceQueueKeyPrefix}, + slashingtypes.StoreKey: {slashingtypes.ValidatorMissedBlockBitmapKeyPrefix}, } - for _, skp := range storeKeysPrefixes { - storeA := ctxA.KVStore(skp.A) - storeB := ctxB.KVStore(skp.B) + storeKeys := bApp.GetStoreKeys() + require.NotEmpty(t, storeKeys) + + for _, appKeyA := range storeKeys { + // only compare kvstores + if _, ok := appKeyA.(*storetypes.KVStoreKey); !ok { + continue + } + + keyName := appKeyA.Name() + appKeyB := newApp.GetKey(keyName) + + storeA := ctxA.KVStore(appKeyA) + storeB := ctxB.KVStore(appKeyB) + + failedKVAs, failedKVBs := simtestutil.DiffKVStores(storeA, storeB, skipPrefixes[keyName]) + require.Equal(t, len(failedKVAs), len(failedKVBs), "unequal sets of key-values to compare %s", keyName) - failedKVAs, failedKVBs := sdk.DiffKVStores(storeA, storeB, skp.Prefixes) - require.Equal(t, len(failedKVAs), len(failedKVBs), "unequal sets of key-values to compare") + fmt.Printf("compared %d different key/value pairs between %s and %s\n", len(failedKVAs), appKeyA, appKeyB) - fmt.Printf("compared %d different key/value pairs between %s and %s\n", len(failedKVAs), skp.A, skp.B) - require.Equal(t, 0, len(failedKVAs), simtestutil.GetSimulationLog(skp.A.Name(), bApp.SimulationManager().StoreDecoders, failedKVAs, failedKVBs)) + require.Equal(t, 0, len(failedKVAs), simtestutil.GetSimulationLog(keyName, bApp.SimulationManager().StoreDecoders, failedKVAs, failedKVBs)) } } func TestAppSimulationAfterImport(t *testing.T) { config := simcli.NewConfigFromFlags() - config.ChainID = app.DefaultChainID + config.ChainID = SimAppChainID - db, dir, logger, skip, err := simtestutil.SetupSimulation( - config, - "leveldb-app-sim", - "Simulation", - simcli.FlagVerboseValue, - simcli.FlagEnabledValue, - ) + db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "leveldb-app-sim", "Simulation", simcli.FlagVerboseValue, simcli.FlagEnabledValue) if skip { t.Skip("skipping application simulation after import") } @@ -317,39 +253,27 @@ func TestAppSimulationAfterImport(t *testing.T) { appOptions[flags.FlagHome] = app.DefaultNodeHome appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue - cmdApp := app.New( - logger, - db, - nil, - true, - map[int64]bool{}, - app.DefaultNodeHome, - 0, - cmd.MakeEncodingConfig(app.ModuleBasics), - appOptions, - fauxMerkleModeOpt, - baseapp.SetChainID(app.DefaultChainID), - ) - bApp, ok := cmdApp.(*app.App) - require.True(t, ok) + bApp, err := app.New(logger, db, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID)) + require.NoError(t, err) + require.Equal(t, app.Name, bApp.Name()) - // run randomized simulation + // Run randomized simulation stopEarly, simParams, simErr := simulation.SimulateFromSeed( t, os.Stdout, bApp.BaseApp, - app.AppStateFn(bApp.AppCodec(), bApp.SimulationManager()), - simtypes.RandomAccounts, // replace with own random account function if using keys other than secp256k1 + simtestutil.AppStateFn(bApp.AppCodec(), bApp.SimulationManager(), bApp.DefaultGenesis()), + simulationtypes.RandomAccounts, simtestutil.SimulationOperations(bApp, bApp.AppCodec(), config), - bApp.BlockedModuleAccountAddrs(), + app.BlockedAddresses(), config, bApp.AppCodec(), ) - require.NoError(t, simErr) // export state and simParams before the simulation error is checked err = simtestutil.CheckExportSimulation(bApp, config, simParams) require.NoError(t, err) + require.NoError(t, simErr) if config.Commit { simtestutil.PrintStats(db) @@ -367,13 +291,7 @@ func TestAppSimulationAfterImport(t *testing.T) { fmt.Printf("importing genesis...\n") - newDB, newDir, _, _, err := simtestutil.SetupSimulation( - config, - "leveldb-app-sim-2", - "Simulation-2", - simcli.FlagVerboseValue, - simcli.FlagEnabledValue, - ) + newDB, newDir, _, _, err := simtestutil.SetupSimulation(config, "leveldb-app-sim-2", "Simulation-2", simcli.FlagVerboseValue, simcli.FlagEnabledValue) require.NoError(t, err, "simulation setup failed") defer func() { @@ -381,35 +299,24 @@ func TestAppSimulationAfterImport(t *testing.T) { require.NoError(t, os.RemoveAll(newDir)) }() - cmdNewApp := app.New( - log.NewNopLogger(), - newDB, - nil, - true, - map[int64]bool{}, - app.DefaultNodeHome, - 0, - cmd.MakeEncodingConfig(app.ModuleBasics), - appOptions, - fauxMerkleModeOpt, - baseapp.SetChainID(app.DefaultChainID), - ) - newApp, ok := cmdNewApp.(*app.App) - require.True(t, ok) + newApp, err := app.New(log.NewNopLogger(), newDB, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID)) + require.NoError(t, err) + require.Equal(t, app.Name, newApp.Name()) - newApp.InitChain(abci.RequestInitChain{ - ChainId: app.DefaultChainID, + _, err = newApp.InitChain(&abci.RequestInitChain{ AppStateBytes: exported.AppState, + ChainId: SimAppChainID, }) + require.NoError(t, err) _, _, err = simulation.SimulateFromSeed( t, os.Stdout, newApp.BaseApp, - app.AppStateFn(bApp.AppCodec(), bApp.SimulationManager()), - simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 + simtestutil.AppStateFn(bApp.AppCodec(), bApp.SimulationManager(), bApp.DefaultGenesis()), + simulationtypes.RandomAccounts, simtestutil.SimulationOperations(newApp, newApp.AppCodec(), config), - newApp.BlockedModuleAccountAddrs(), + app.BlockedAddresses(), config, bApp.AppCodec(), ) @@ -426,65 +333,77 @@ func TestAppStateDeterminism(t *testing.T) { config.ExportParamsPath = "" config.OnOperation = true config.AllInvariants = true - config.ChainID = app.DefaultChainID - var ( - r = rand.New(rand.NewSource(time.Now().Unix())) - numSeeds = 3 - numTimesToRunPerSeed = 5 - appHashList = make([]json.RawMessage, numTimesToRunPerSeed) - ) + numSeeds := 3 + numTimesToRunPerSeed := 3 // This used to be set to 5, but we've temporarily reduced it to 3 for the sake of faster CI. + appHashList := make([]json.RawMessage, numTimesToRunPerSeed) - appOptions := make(simtestutil.AppOptionsMap, 0) - appOptions[flags.FlagHome] = app.DefaultNodeHome - appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + // We will be overriding the random seed and just run a single simulation on the provided seed value + if config.Seed != simcli.DefaultSeedValue { + numSeeds = 1 + } + + appOptions := viper.New() + if FlagEnableStreamingValue { + m := make(map[string]interface{}) + m["streaming.abci.keys"] = []string{"*"} + m["streaming.abci.plugin"] = "abci_v1" + m["streaming.abci.stop-node-on-err"] = true + for key, value := range m { + appOptions.SetDefault(key, value) + } + } + appOptions.SetDefault(flags.FlagHome, app.DefaultNodeHome) + appOptions.SetDefault(server.FlagInvCheckPeriod, simcli.FlagPeriodValue) + if simcli.FlagVerboseValue { + appOptions.SetDefault(flags.FlagLogLevel, "debug") + } for i := 0; i < numSeeds; i++ { - config.Seed = r.Int63() + if config.Seed == simcli.DefaultSeedValue { + config.Seed = rand.Int63() + } + fmt.Println("config.Seed: ", config.Seed) for j := 0; j < numTimesToRunPerSeed; j++ { var logger log.Logger if simcli.FlagVerboseValue { - logger = log.TestingLogger() + logger = log.NewTestLogger(t) } else { logger = log.NewNopLogger() } - - var ( - chainID = fmt.Sprintf("chain-id-%d-%d", i, j) - db = dbm.NewMemDB() - cmdApp = app.New( - logger, - db, - nil, - true, - map[int64]bool{}, - app.DefaultNodeHome, - simcli.FlagPeriodValue, - cmd.MakeEncodingConfig(app.ModuleBasics), - appOptions, - fauxMerkleModeOpt, - baseapp.SetChainID(chainID), - ) - ) + chainID := fmt.Sprintf("chain-id-%d-%d", i, j) config.ChainID = chainID - bApp, ok := cmdApp.(*app.App) - require.True(t, ok) + db := dbm.NewMemDB() + bApp, err := app.New( + logger, + db, + nil, + true, + appOptions, + interBlockCacheOpt(), + baseapp.SetChainID(chainID), + ) + require.NoError(t, err) fmt.Printf( "running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d\n", config.Seed, i+1, numSeeds, j+1, numTimesToRunPerSeed, ) - _, _, err := simulation.SimulateFromSeed( + _, _, err = simulation.SimulateFromSeed( t, os.Stdout, bApp.BaseApp, - app.AppStateFn(bApp.AppCodec(), bApp.SimulationManager()), - simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 + simtestutil.AppStateFn( + bApp.AppCodec(), + bApp.SimulationManager(), + bApp.DefaultGenesis(), + ), + simulationtypes.RandomAccounts, simtestutil.SimulationOperations(bApp, bApp.AppCodec(), config), - bApp.BlockedModuleAccountAddrs(), + app.BlockedAddresses(), config, bApp.AppCodec(), ) diff --git a/app/state.go b/app/state.go deleted file mode 100644 index ca7ad58f..00000000 --- a/app/state.go +++ /dev/null @@ -1,246 +0,0 @@ -package app - -// DONTCOVER - -import ( - "encoding/json" - "fmt" - "io" - "math/rand" - "os" - "time" - - tmjson "github.com/cometbft/cometbft/libs/json" - tmtypes "github.com/cometbft/cometbft/types" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - 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" -) - -var FlagGenesisTimeValue = int64(1640995200) - -// AppStateFn returns the initial application state using a genesis or the simulation parameters. -// It panics if the user provides files for both of them. -// If a file is not given for the genesis or the sim params, it creates a randomized one. -func AppStateFn(cdc codec.JSONCodec, simManager *module.SimulationManager) simtypes.AppStateFn { - return func(r *rand.Rand, accs []simtypes.Account, config simtypes.Config, - ) (appState json.RawMessage, simAccs []simtypes.Account, chainID string, genesisTimestamp time.Time) { - - if FlagGenesisTimeValue == 0 { - genesisTimestamp = simtypes.RandTimestamp(r) - } else { - genesisTimestamp = time.Unix(FlagGenesisTimeValue, 0) - } - - chainID = config.ChainID - switch { - case config.ParamsFile != "" && config.GenesisFile != "": - panic("cannot provide both a genesis file and a params file") - - case config.GenesisFile != "": - // override the default chain-id from simapp to set it later to the config - genesisDoc, accounts := AppStateFromGenesisFileFn(r, cdc, config.GenesisFile) - - if FlagGenesisTimeValue == 0 { - // use genesis timestamp if no custom timestamp is provided (i.e no random timestamp) - genesisTimestamp = genesisDoc.GenesisTime - } - - appState = genesisDoc.AppState - chainID = genesisDoc.ChainID - simAccs = accounts - - case config.ParamsFile != "": - appParams := make(simtypes.AppParams) - bz, err := os.ReadFile(config.ParamsFile) - if err != nil { - panic(err) - } - - err = json.Unmarshal(bz, &appParams) - if err != nil { - panic(err) - } - appState, simAccs = AppStateRandomizedFn(simManager, r, cdc, accs, genesisTimestamp, appParams) - - default: - appParams := make(simtypes.AppParams) - appState, simAccs = AppStateRandomizedFn(simManager, r, cdc, accs, genesisTimestamp, appParams) - } - - rawState := make(map[string]json.RawMessage) - err := json.Unmarshal(appState, &rawState) - if err != nil { - panic(err) - } - - stakingStateBz, ok := rawState[stakingtypes.ModuleName] - if !ok { - panic("staking genesis state is missing") - } - - stakingState := new(stakingtypes.GenesisState) - err = cdc.UnmarshalJSON(stakingStateBz, stakingState) - if err != nil { - panic(err) - } - // compute not bonded balance - notBondedTokens := sdk.ZeroInt() - for _, val := range stakingState.Validators { - if val.Status != stakingtypes.Unbonded { - continue - } - notBondedTokens = notBondedTokens.Add(val.GetTokens()) - } - notBondedCoins := sdk.NewCoin(stakingState.Params.BondDenom, notBondedTokens) - - // edit bank state to make it have the not bonded pool tokens - bankStateBz, ok := rawState[banktypes.ModuleName] - if !ok { - panic("bank genesis state is missing") - } - bankState := new(banktypes.GenesisState) - err = cdc.UnmarshalJSON(bankStateBz, bankState) - if err != nil { - panic(err) - } - - stakingAddr := authtypes.NewModuleAddress(stakingtypes.NotBondedPoolName).String() - var found bool - for _, balance := range bankState.Balances { - if balance.Address == stakingAddr { - found = true - break - } - } - if !found { - bankState.Balances = append(bankState.Balances, banktypes.Balance{ - Address: stakingAddr, - Coins: sdk.NewCoins(notBondedCoins), - }) - } - - // change appState back - rawState[stakingtypes.ModuleName] = cdc.MustMarshalJSON(stakingState) - rawState[banktypes.ModuleName] = cdc.MustMarshalJSON(bankState) - - // replace appstate - appState, err = json.Marshal(rawState) - if err != nil { - panic(err) - } - return appState, simAccs, chainID, genesisTimestamp - } -} - -// AppStateRandomizedFn creates calls each module's GenesisState generator function -// and creates the simulation params -func AppStateRandomizedFn( - simManager *module.SimulationManager, r *rand.Rand, cdc codec.JSONCodec, - accs []simtypes.Account, genesisTimestamp time.Time, appParams simtypes.AppParams, -) (json.RawMessage, []simtypes.Account) { - numAccs := int64(len(accs)) - genesisState := NewDefaultGenesisState(cdc) - - // generate a random amount of initial stake coins and a random initial - // number of bonded accounts - var initialStake, numInitiallyBonded int64 - appParams.GetOrGenerate( - cdc, simtestutil.StakePerAccount, &initialStake, r, - func(r *rand.Rand) { initialStake = r.Int63n(1e12) }, - ) - appParams.GetOrGenerate( - cdc, simtestutil.InitiallyBondedValidators, &numInitiallyBonded, r, - func(r *rand.Rand) { numInitiallyBonded = int64(r.Intn(300)) }, - ) - - if numInitiallyBonded > numAccs { - numInitiallyBonded = numAccs - } - - fmt.Printf( - `Selected randomly generated parameters for simulated genesis: -{ - stake_per_account: "%d", - initially_bonded_validators: "%d" -} -`, initialStake, numInitiallyBonded, - ) - - simState := &module.SimulationState{ - AppParams: appParams, - Cdc: cdc, - Rand: r, - GenState: genesisState, - Accounts: accs, - InitialStake: sdk.NewInt(initialStake), - NumBonded: numInitiallyBonded, - GenTimestamp: genesisTimestamp, - } - - simManager.GenerateGenesisStates(simState) - - appState, err := json.Marshal(genesisState) - if err != nil { - panic(err) - } - - return appState, accs -} - -// AppStateFromGenesisFileFn util function to generate the genesis AppState -// from a genesis.json file. -func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile string) (tmtypes.GenesisDoc, []simtypes.Account) { - bytes, err := os.ReadFile(genesisFile) - if err != nil { - panic(err) - } - - var genesis tmtypes.GenesisDoc - // NOTE: Tendermint uses a custom JSON decoder for GenesisDoc - err = tmjson.Unmarshal(bytes, &genesis) - if err != nil { - panic(err) - } - - var appState GenesisState - err = json.Unmarshal(genesis.AppState, &appState) - if err != nil { - panic(err) - } - - var authGenesis authtypes.GenesisState - if appState[authtypes.ModuleName] != nil { - cdc.MustUnmarshalJSON(appState[authtypes.ModuleName], &authGenesis) - } - - newAccs := make([]simtypes.Account, len(authGenesis.Accounts)) - for i, acc := range authGenesis.Accounts { - // Pick a random private key, since we don't know the actual key - // This should be fine as it's only used for mock Tendermint validators - // and these keys are never actually used to sign by mock Tendermint. - privkeySeed := make([]byte, 15) - if _, err := r.Read(privkeySeed); err != nil { - panic(err) - } - - privKey := secp256k1.GenPrivKeyFromSecret(privkeySeed) - - a, ok := acc.GetCachedValue().(authtypes.AccountI) - if !ok { - panic("expected account") - } - - // create simulator accounts - simAcc := simtypes.Account{PrivKey: privKey, PubKey: privKey.PubKey(), Address: a.GetAddress()} - newAccs[i] = simAcc - } - - return genesis, newAccs -} diff --git a/buf.work.yaml b/buf.work.yaml index 1b4a0d95..1878b341 100644 --- a/buf.work.yaml +++ b/buf.work.yaml @@ -1,8 +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 diff --git a/client/docs/docs.go b/client/docs/docs.go deleted file mode 100644 index 488e5fe3..00000000 --- a/client/docs/docs.go +++ /dev/null @@ -1,5 +0,0 @@ -package docs - -import "net/http" - -var Docs http.FileSystem diff --git a/client/docs/static/openapi.yml b/client/docs/static/openapi.yml deleted file mode 100644 index 48f69bb3..00000000 --- a/client/docs/static/openapi.yml +++ /dev/null @@ -1,55838 +0,0 @@ -swagger: '2.0' -info: - title: HTTP API Console - name: '' - description: '' -paths: - /cosmos/auth/v1beta1/account_info/{address}: - get: - summary: AccountInfo queries account info which is common to all account types. - description: 'Since: cosmos-sdk 0.47' - operationId: CosmosAuthV1Beta1AccountInfo - responses: - '200': - description: A successful response. - schema: - type: object - properties: - info: - description: info is the account info which is represented by BaseAccount. - type: object - properties: - address: - type: string - pub_key: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - account_number: - type: string - format: uint64 - sequence: - type: string - format: uint64 - description: |- - QueryAccountInfoResponse is the Query/AccountInfo response type. - - Since: cosmos-sdk 0.47 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: address - description: address is the account address string. - in: path - required: true - type: string - tags: - - Query - /cosmos/auth/v1beta1/accounts: - get: - summary: Accounts returns all the existing accounts. - description: >- - When called from another module, this query might consume a high amount - of - - gas if the pagination field is incorrectly set. - - - Since: cosmos-sdk 0.43 - operationId: CosmosAuthV1Beta1Accounts - responses: - '200': - description: A successful response. - schema: - type: object - properties: - accounts: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: accounts are the existing accounts - 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: >- - QueryAccountsResponse is the response type for the Query/Accounts - RPC method. - - - Since: cosmos-sdk 0.43 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - 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/auth/v1beta1/accounts/{address}: - get: - summary: Account returns account details based on address. - operationId: CosmosAuthV1Beta1Account - responses: - '200': - description: A successful response. - schema: - type: object - properties: - account: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - QueryAccountResponse is the response type for the Query/Account - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: address - description: address defines the address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/auth/v1beta1/address_by_id/{id}: - get: - summary: AccountAddressByID returns account address based on account number. - description: 'Since: cosmos-sdk 0.46.2' - operationId: CosmosAuthV1Beta1AccountAddressByID - responses: - '200': - description: A successful response. - schema: - type: object - properties: - account_address: - type: string - description: 'Since: cosmos-sdk 0.46.2' - title: >- - QueryAccountAddressByIDResponse is the response type for - AccountAddressByID rpc method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: id - description: |- - Deprecated, use account_id instead - - id is the account number of the address to be queried. This field - should have been an uint64 (like all account numbers), and will be - updated to uint64 in a future version of the auth query. - in: path - required: true - type: string - format: int64 - - name: account_id - description: |- - account_id is the account number of the address to be queried. - - Since: cosmos-sdk 0.47 - in: query - required: false - type: string - format: uint64 - tags: - - Query - /cosmos/auth/v1beta1/bech32: - get: - summary: Bech32Prefix queries bech32Prefix - description: 'Since: cosmos-sdk 0.46' - operationId: CosmosAuthV1Beta1Bech32Prefix - responses: - '200': - description: A successful response. - schema: - type: object - properties: - bech32_prefix: - type: string - description: >- - Bech32PrefixResponse is the response type for Bech32Prefix rpc - method. - - - Since: cosmos-sdk 0.46 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - tags: - - Query - /cosmos/auth/v1beta1/bech32/{address_bytes}: - get: - summary: AddressBytesToString converts Account Address bytes to string - description: 'Since: cosmos-sdk 0.46' - operationId: CosmosAuthV1Beta1AddressBytesToString - responses: - '200': - description: A successful response. - schema: - type: object - properties: - address_string: - type: string - description: >- - AddressBytesToStringResponse is the response type for - AddressString rpc method. - - - Since: cosmos-sdk 0.46 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: address_bytes - in: path - required: true - type: string - format: byte - tags: - - Query - /cosmos/auth/v1beta1/bech32/{address_string}: - get: - summary: AddressStringToBytes converts Address string to bytes - description: 'Since: cosmos-sdk 0.46' - operationId: CosmosAuthV1Beta1AddressStringToBytes - responses: - '200': - description: A successful response. - schema: - type: object - properties: - address_bytes: - type: string - format: byte - description: >- - AddressStringToBytesResponse is the response type for AddressBytes - rpc method. - - - Since: cosmos-sdk 0.46 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: address_string - in: path - required: true - type: string - tags: - - Query - /cosmos/auth/v1beta1/module_accounts: - get: - summary: ModuleAccounts returns all the existing module accounts. - description: 'Since: cosmos-sdk 0.46' - operationId: CosmosAuthV1Beta1ModuleAccounts - responses: - '200': - description: A successful response. - schema: - type: object - properties: - accounts: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - QueryModuleAccountsResponse is the response type for the - Query/ModuleAccounts RPC method. - - - Since: cosmos-sdk 0.46 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - tags: - - Query - /cosmos/auth/v1beta1/module_accounts/{name}: - get: - summary: ModuleAccountByName returns the module account info by module name - operationId: CosmosAuthV1Beta1ModuleAccountByName - responses: - '200': - description: A successful response. - schema: - type: object - properties: - account: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - QueryModuleAccountByNameResponse is the response type for the - Query/ModuleAccountByName RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: name - in: path - required: true - type: string - tags: - - Query - /cosmos/auth/v1beta1/params: - get: - summary: Params queries all parameters. - operationId: CosmosAuthV1Beta1Params - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - description: params defines the parameters of the module. - type: object - properties: - max_memo_characters: - type: string - format: uint64 - tx_sig_limit: - type: string - format: uint64 - tx_size_cost_per_byte: - type: string - format: uint64 - sig_verify_cost_ed25519: - type: string - format: uint64 - sig_verify_cost_secp256k1: - type: string - format: uint64 - description: >- - QueryParamsResponse is the response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - tags: - - Query - /cosmos/authz/v1beta1/grants: - get: - summary: Returns list of `Authorization`, granted to the grantee by the granter. - operationId: CosmosAuthzV1Beta1Grants - responses: - '200': - description: A successful response. - schema: - type: object - properties: - grants: - type: array - items: - type: object - properties: - authorization: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message - [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - expiration: - type: string - format: date-time - title: >- - time when the grant will expire and will be pruned. If - null, then the grant - - doesn't have a time expiration (other conditions in - `authorization` - - may apply to invalidate the grant) - description: |- - Grant gives permissions to execute - the provide method with expiration time. - description: >- - authorizations is a list of grants granted for grantee by - granter. - pagination: - description: pagination defines an pagination for 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: >- - QueryGrantsResponse is the response type for the - Query/Authorizations RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: granter - in: query - required: false - type: string - - name: grantee - in: query - required: false - type: string - - name: msg_type_url - description: >- - Optional, msg_type_url, when set, will query only grants matching - given msg type. - 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 - type: boolean - tags: - - Query - /cosmos/authz/v1beta1/grants/grantee/{grantee}: - get: - summary: GranteeGrants returns a list of `GrantAuthorization` by grantee. - description: 'Since: cosmos-sdk 0.46' - operationId: CosmosAuthzV1Beta1GranteeGrants - responses: - '200': - description: A successful response. - schema: - type: object - properties: - grants: - type: array - items: - type: object - properties: - granter: - type: string - grantee: - type: string - authorization: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message - [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - expiration: - type: string - format: date-time - title: >- - GrantAuthorization extends a grant with both the addresses - of the grantee and granter. - - It is used in genesis.proto and query.proto - description: grants is a list of grants granted to the grantee. - pagination: - description: pagination defines an pagination for 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: >- - QueryGranteeGrantsResponse is the response type for the - Query/GranteeGrants RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: grantee - in: path - required: true - 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 - type: boolean - tags: - - Query - /cosmos/authz/v1beta1/grants/granter/{granter}: - get: - summary: GranterGrants returns list of `GrantAuthorization`, granted by granter. - description: 'Since: cosmos-sdk 0.46' - operationId: CosmosAuthzV1Beta1GranterGrants - responses: - '200': - description: A successful response. - schema: - type: object - properties: - grants: - type: array - items: - type: object - properties: - granter: - type: string - grantee: - type: string - authorization: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message - [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - expiration: - type: string - format: date-time - title: >- - GrantAuthorization extends a grant with both the addresses - of the grantee and granter. - - It is used in genesis.proto and query.proto - description: grants is a list of grants granted by the granter. - pagination: - description: pagination defines an pagination for 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: >- - QueryGranterGrantsResponse is the response type for the - Query/GranterGrants RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: granter - in: path - required: true - 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 - type: boolean - tags: - - Query - /cosmos/bank/v1beta1/balances/{address}: - get: - summary: AllBalances queries the balance of all coins for a single account. - description: >- - When called from another module, this query might consume a high amount - of - - gas if the pagination field is incorrectly set. - operationId: CosmosBankV1Beta1AllBalances - responses: - '200': - description: A successful response. - schema: - type: object - properties: - balances: - type: array - items: - 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: balances is the balances of all the coins. - 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: >- - QueryAllBalancesResponse is the response type for the - Query/AllBalances RPC - - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: address - description: address is the address to query balances for. - in: path - required: true - 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 - type: boolean - tags: - - Query - /cosmos/bank/v1beta1/balances/{address}/by_denom: - get: - summary: Balance queries the balance of a single coin for a single account. - operationId: CosmosBankV1Beta1Balance - responses: - '200': - description: A successful response. - schema: - type: object - properties: - balance: - description: balance is the balance of the coin. - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - QueryBalanceResponse is the response type for the Query/Balance - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: address - description: address is the address to query balances for. - in: path - required: true - type: string - - name: denom - description: denom is the coin denom to query balances for. - in: query - required: false - type: string - tags: - - Query - /cosmos/bank/v1beta1/denom_owners/{denom}: - get: - summary: >- - DenomOwners queries for all account addresses that own a particular - token - - denomination. - description: >- - When called from another module, this query might consume a high amount - of - - gas if the pagination field is incorrectly set. - - - Since: cosmos-sdk 0.46 - operationId: CosmosBankV1Beta1DenomOwners - 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: - description: >- - balance is the balance of the denominated coin for an - account. - type: object - properties: - denom: - type: string - amount: - type: string - 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: >- - QueryDenomOwnersResponse defines the RPC response of a DenomOwners - RPC query. - - - Since: cosmos-sdk 0.46 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: denom - description: >- - denom defines the coin denomination to query all account holders - for. - in: path - required: true - 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 - type: boolean - tags: - - Query - /cosmos/bank/v1beta1/denoms_metadata: - get: - summary: |- - DenomsMetadata queries the client metadata for all registered coin - denominations. - operationId: CosmosBankV1Beta1DenomsMetadata - responses: - '200': - description: A successful response. - schema: - type: object - properties: - metadatas: - type: array - items: - 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: >- - metadata provides the client information for all the - registered tokens. - 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: >- - QueryDenomsMetadataResponse is the response type for the - Query/DenomsMetadata RPC - - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - 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/bank/v1beta1/denoms_metadata/{denom}: - get: - summary: DenomsMetadata queries the client metadata of a given coin denomination. - operationId: CosmosBankV1Beta1DenomMetadata - responses: - '200': - description: A successful response. - schema: - type: object - properties: - metadata: - description: >- - metadata describes and provides all the client information for - the requested token. - 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: >- - QueryDenomMetadataResponse is the response type for the - Query/DenomMetadata RPC - - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: denom - description: denom is the coin denom to query the metadata for. - in: path - required: true - type: string - tags: - - Query - /cosmos/bank/v1beta1/params: - get: - summary: Params queries the parameters of x/bank module. - operationId: CosmosBankV1Beta1Params - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - type: object - properties: - send_enabled: - type: array - items: - type: object - properties: - denom: - type: string - enabled: - type: boolean - description: >- - SendEnabled maps coin denom to a send_enabled status - (whether a denom is - - sendable). - description: >- - Deprecated: Use of SendEnabled in params is deprecated. - - For genesis, use the newly added send_enabled field in the - genesis object. - - Storage, lookup, and manipulation of this information is - now in the keeper. - - - As of cosmos-sdk 0.47, this only exists for backwards - 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. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /cosmos/bank/v1beta1/send_enabled: - get: - summary: SendEnabled queries for SendEnabled entries. - description: >- - This query only returns denominations that have specific SendEnabled - settings. - - Any denomination that does not have a specific setting will use the - default - - params.default_send_enabled, and will not be returned by this query. - - - Since: cosmos-sdk 0.47 - operationId: CosmosBankV1Beta1SendEnabled - responses: - '200': - description: A successful response. - schema: - type: object - properties: - send_enabled: - type: array - items: - type: object - properties: - denom: - type: string - enabled: - type: boolean - description: >- - SendEnabled maps coin denom to a send_enabled status - (whether a denom is - - sendable). - pagination: - description: >- - pagination defines the pagination in the response. This field - is only - - populated if the denoms field in the request is empty. - 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: >- - QuerySendEnabledResponse defines the RPC response of a SendEnable - query. - - - Since: cosmos-sdk 0.47 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: denoms - description: >- - denoms is the specific denoms you want look up. Leave empty to get - all entries. - in: query - required: false - type: array - items: - type: string - collectionFormat: multi - - 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/bank/v1beta1/spendable_balances/{address}: - get: - summary: >- - SpendableBalances queries the spendable balance of all coins for a - single - - account. - description: >- - When called from another module, this query might consume a high amount - of - - gas if the pagination field is incorrectly set. - - - Since: cosmos-sdk 0.46 - operationId: CosmosBankV1Beta1SpendableBalances - responses: - '200': - description: A successful response. - schema: - type: object - properties: - balances: - type: array - items: - 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: balances is the spendable balances of all the coins. - 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: >- - QuerySpendableBalancesResponse defines the gRPC response structure - for querying - - an account's spendable balances. - - - Since: cosmos-sdk 0.46 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: address - description: address is the address to query spendable balances for. - in: path - required: true - 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 - type: boolean - tags: - - Query - /cosmos/bank/v1beta1/spendable_balances/{address}/by_denom: - get: - summary: >- - SpendableBalanceByDenom queries the spendable balance of a single denom - for - - a single account. - description: >- - When called from another module, this query might consume a high amount - of - - gas if the pagination field is incorrectly set. - - - Since: cosmos-sdk 0.47 - operationId: CosmosBankV1Beta1SpendableBalanceByDenom - responses: - '200': - description: A successful response. - schema: - type: object - properties: - balance: - description: balance is the balance of the coin. - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - QuerySpendableBalanceByDenomResponse defines the gRPC response - structure for - - querying an account's spendable balance for a specific denom. - - - Since: cosmos-sdk 0.47 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: address - description: address is the address to query balances for. - in: path - required: true - type: string - - name: denom - description: denom is the coin denom to query balances for. - in: query - required: false - type: string - tags: - - Query - /cosmos/bank/v1beta1/supply: - get: - summary: TotalSupply queries the total supply of all coins. - description: >- - When called from another module, this query might consume a high amount - of - - gas if the pagination field is incorrectly set. - operationId: CosmosBankV1Beta1TotalSupply - responses: - '200': - description: A successful response. - schema: - type: object - properties: - supply: - type: array - items: - 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. - title: supply is the supply of the coins - pagination: - description: |- - pagination defines the pagination in the response. - - Since: cosmos-sdk 0.43 - 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 - title: >- - QueryTotalSupplyResponse is the response type for the - Query/TotalSupply RPC - - method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - 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/bank/v1beta1/supply/by_denom: - get: - summary: SupplyOf queries the supply of a single coin. - description: >- - When called from another module, this query might consume a high amount - of - - gas if the pagination field is incorrectly set. - operationId: CosmosBankV1Beta1SupplyOf - responses: - '200': - description: A successful response. - schema: - type: object - properties: - amount: - description: amount is the supply of the coin. - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - QuerySupplyOfResponse is the response type for the Query/SupplyOf - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: denom - description: denom is the coin denom to query balances for. - in: query - required: false - type: string - tags: - - Query - /cosmos/base/node/v1beta1/config: - get: - summary: Config queries for the operator configuration. - operationId: CosmosBaseNodeV1Beta1Config - responses: - '200': - description: A successful response. - schema: - type: object - properties: - minimum_gas_price: - type: string - description: >- - ConfigResponse defines the response structure for the Config gRPC - query. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Service - /cosmos/base/tendermint/v1beta1/abci_query: - get: - summary: >- - ABCIQuery defines a query handler that supports ABCI queries directly to - the - - application, bypassing Tendermint completely. The ABCI query must - contain - - a valid and supported path, including app, custom, p2p, and store. - description: 'Since: cosmos-sdk 0.46' - operationId: CosmosBaseTendermintV1Beta1ABCIQuery - responses: - '200': - description: A successful response. - schema: - type: object - properties: - code: - type: integer - format: int64 - log: - type: string - title: nondeterministic - info: - type: string - title: nondeterministic - index: - type: string - format: int64 - key: - type: string - format: byte - value: - type: string - format: byte - proof_ops: - type: object - properties: - ops: - type: array - items: - type: object - properties: - type: - type: string - key: - type: string - format: byte - data: - type: string - format: byte - description: >- - ProofOp defines an operation used for calculating Merkle - root. The data could - - be arbitrary format, providing necessary data for - example neighbouring node - - hash. - - - Note: This type is a duplicate of the ProofOp proto type - defined in Tendermint. - description: >- - ProofOps is Merkle proof defined by the list of ProofOps. - - - Note: This type is a duplicate of the ProofOps proto type - defined in Tendermint. - height: - type: string - format: int64 - codespace: - type: string - description: >- - ABCIQueryResponse defines the response structure for the ABCIQuery - gRPC query. - - - Note: This type is a duplicate of the ResponseQuery proto type - defined in - - Tendermint. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: data - in: query - required: false - type: string - format: byte - - name: path - in: query - required: false - type: string - - name: height - in: query - required: false - type: string - format: int64 - - name: prove - in: query - required: false - type: boolean - tags: - - Service - /cosmos/base/tendermint/v1beta1/blocks/latest: - get: - summary: GetLatestBlock returns the latest block. - operationId: CosmosBaseTendermintV1Beta1GetLatestBlock - responses: - '200': - description: A successful response. - schema: - type: object - properties: - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - block: - title: 'Deprecated: please use `sdk_block` instead' - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing - a block in the blockchain, - - including all blockchain data structures and the rules - of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs from the - previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - data: - type: object - properties: - txs: - type: array - items: - type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. - - NOTE: not all txs here are valid. We're just agreeing - on the order first. - - This means that block.AppHash does not include these - txs. - title: >- - Data contains the set of transactions included in the - block - evidence: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed - message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or - commit vote from validators for - - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed - message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or - commit vote from validators for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a - validator signed two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules - for processing a block in the - blockchain, - - including all blockchain data structures - and the rules of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: >- - commit from validators from the last - block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs - from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: >- - Header defines the structure of a block - header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a - block was committed by a set of - validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a - set of validators attempting to mislead a light - client. - last_commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included in a - Commit. - description: >- - Commit contains the evidence that a block was committed by - a set of validators. - sdk_block: - title: 'Since: cosmos-sdk 0.47' - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing - a block in the blockchain, - - including all blockchain data structures and the rules - of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs from the - previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - description: >- - proposer_address is the original block proposer - address, formatted as a Bech32 string. - - In Tendermint, this type is `bytes`, but in the SDK, - we convert it to a Bech32 string - - for better UX. - - - original proposer of the block - description: Header defines the structure of a Tendermint block header. - data: - type: object - properties: - txs: - type: array - items: - type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. - - NOTE: not all txs here are valid. We're just agreeing - on the order first. - - This means that block.AppHash does not include these - txs. - title: >- - Data contains the set of transactions included in the - block - evidence: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed - message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or - commit vote from validators for - - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed - message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or - commit vote from validators for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a - validator signed two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules - for processing a block in the - blockchain, - - including all blockchain data structures - and the rules of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: >- - commit from validators from the last - block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs - from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: >- - Header defines the structure of a block - header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a - block was committed by a set of - validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a - set of validators attempting to mislead a light - client. - last_commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included in a - Commit. - description: >- - Commit contains the evidence that a block was committed by - a set of validators. - description: >- - Block is tendermint type Block, with the Header proposer - address - - field converted to bech32 string. - description: >- - GetLatestBlockResponse is the response type for the - Query/GetLatestBlock RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - tags: - - Service - /cosmos/base/tendermint/v1beta1/blocks/{height}: - get: - summary: GetBlockByHeight queries block for given height. - operationId: CosmosBaseTendermintV1Beta1GetBlockByHeight - responses: - '200': - description: A successful response. - schema: - type: object - properties: - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - block: - title: 'Deprecated: please use `sdk_block` instead' - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing - a block in the blockchain, - - including all blockchain data structures and the rules - of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs from the - previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - data: - type: object - properties: - txs: - type: array - items: - type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. - - NOTE: not all txs here are valid. We're just agreeing - on the order first. - - This means that block.AppHash does not include these - txs. - title: >- - Data contains the set of transactions included in the - block - evidence: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed - message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or - commit vote from validators for - - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed - message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or - commit vote from validators for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a - validator signed two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules - for processing a block in the - blockchain, - - including all blockchain data structures - and the rules of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: >- - commit from validators from the last - block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs - from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: >- - Header defines the structure of a block - header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a - block was committed by a set of - validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a - set of validators attempting to mislead a light - client. - last_commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included in a - Commit. - description: >- - Commit contains the evidence that a block was committed by - a set of validators. - sdk_block: - title: 'Since: cosmos-sdk 0.47' - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing - a block in the blockchain, - - including all blockchain data structures and the rules - of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs from the - previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - description: >- - proposer_address is the original block proposer - address, formatted as a Bech32 string. - - In Tendermint, this type is `bytes`, but in the SDK, - we convert it to a Bech32 string - - for better UX. - - - original proposer of the block - description: Header defines the structure of a Tendermint block header. - data: - type: object - properties: - txs: - type: array - items: - type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. - - NOTE: not all txs here are valid. We're just agreeing - on the order first. - - This means that block.AppHash does not include these - txs. - title: >- - Data contains the set of transactions included in the - block - evidence: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed - message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or - commit vote from validators for - - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed - message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or - commit vote from validators for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a - validator signed two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules - for processing a block in the - blockchain, - - including all blockchain data structures - and the rules of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: >- - commit from validators from the last - block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs - from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: >- - Header defines the structure of a block - header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a - block was committed by a set of - validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a - set of validators attempting to mislead a light - client. - last_commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included in a - Commit. - description: >- - Commit contains the evidence that a block was committed by - a set of validators. - description: >- - Block is tendermint type Block, with the Header proposer - address - - field converted to bech32 string. - description: >- - GetBlockByHeightResponse is the response type for the - Query/GetBlockByHeight RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: height - in: path - required: true - type: string - format: int64 - tags: - - Service - /cosmos/base/tendermint/v1beta1/node_info: - get: - summary: GetNodeInfo queries the current node info. - operationId: CosmosBaseTendermintV1Beta1GetNodeInfo - responses: - '200': - description: A successful response. - schema: - type: object - properties: - default_node_info: - type: object - properties: - protocol_version: - type: object - properties: - p2p: - type: string - format: uint64 - block: - type: string - format: uint64 - app: - type: string - format: uint64 - default_node_id: - type: string - listen_addr: - type: string - network: - type: string - version: - type: string - channels: - type: string - format: byte - moniker: - type: string - other: - type: object - properties: - tx_index: - type: string - rpc_address: - type: string - application_version: - type: object - properties: - name: - type: string - app_name: - type: string - version: - type: string - git_commit: - type: string - build_tags: - type: string - go_version: - type: string - build_deps: - type: array - items: - type: object - properties: - path: - type: string - title: module path - version: - type: string - title: module version - sum: - type: string - title: checksum - title: Module is the type for VersionInfo - cosmos_sdk_version: - type: string - title: 'Since: cosmos-sdk 0.43' - description: VersionInfo is the type for the GetNodeInfoResponse message. - description: >- - GetNodeInfoResponse is the response type for the Query/GetNodeInfo - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - tags: - - Service - /cosmos/base/tendermint/v1beta1/syncing: - get: - summary: GetSyncing queries node syncing. - operationId: CosmosBaseTendermintV1Beta1GetSyncing - responses: - '200': - description: A successful response. - schema: - type: object - properties: - syncing: - type: boolean - description: >- - GetSyncingResponse is the response type for the Query/GetSyncing - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - tags: - - Service - /cosmos/base/tendermint/v1beta1/validatorsets/latest: - get: - summary: GetLatestValidatorSet queries latest validator-set. - operationId: CosmosBaseTendermintV1Beta1GetLatestValidatorSet - responses: - '200': - description: A successful response. - schema: - type: object - properties: - block_height: - type: string - format: int64 - validators: - type: array - items: - type: object - properties: - address: - type: string - pub_key: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message - [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - description: Validator is the type for the validator-set. - pagination: - description: pagination defines an pagination for 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: >- - GetLatestValidatorSetResponse is the response type for the - Query/GetValidatorSetByHeight RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - 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: - - Service - /cosmos/base/tendermint/v1beta1/validatorsets/{height}: - get: - summary: GetValidatorSetByHeight queries validator-set at a given height. - operationId: CosmosBaseTendermintV1Beta1GetValidatorSetByHeight - responses: - '200': - description: A successful response. - schema: - type: object - properties: - block_height: - type: string - format: int64 - validators: - type: array - items: - type: object - properties: - address: - type: string - pub_key: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message - [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - description: Validator is the type for the validator-set. - pagination: - description: pagination defines an pagination for 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: >- - GetValidatorSetByHeightResponse is the response type for the - Query/GetValidatorSetByHeight RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: height - in: path - required: true - type: string - format: int64 - - 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: - - Service - /cosmos/consensus/v1/params: - get: - summary: Params queries the parameters of x/consensus_param module. - operationId: CosmosConsensusV1Params - 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. - description: >- - QueryParamsResponse defines the response type for querying - x/consensus parameters. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /cosmos/distribution/v1beta1/community_pool: - get: - summary: CommunityPool queries the community pool coins. - operationId: CosmosDistributionV1Beta1CommunityPool - responses: - '200': - description: A successful response. - schema: - type: object - properties: - pool: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - description: pool defines community pool's coins. - description: >- - QueryCommunityPoolResponse is the response type for the - Query/CommunityPool - - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards: - get: - summary: |- - DelegationTotalRewards queries the total rewards accrued by a each - validator. - operationId: CosmosDistributionV1Beta1DelegationTotalRewards - responses: - '200': - description: A successful response. - schema: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - validator_address: - type: string - reward: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a - decimal amount. - - - NOTE: The amount field is an Dec which implements the - custom method - - signatures required by gogoproto. - description: |- - DelegationDelegatorReward represents the properties - of a delegator's delegation reward. - description: rewards defines all the rewards accrued by a delegator. - total: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - description: total defines the sum of all the rewards. - description: |- - QueryDelegationTotalRewardsResponse is the response type for the - Query/DelegationTotalRewards RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: delegator_address - description: delegator_address defines the delegator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}: - get: - summary: DelegationRewards queries the total rewards accrued by a delegation. - operationId: CosmosDistributionV1Beta1DelegationRewards - responses: - '200': - description: A successful response. - schema: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - description: rewards defines the rewards accrued by a delegation. - description: |- - QueryDelegationRewardsResponse is the response type for the - Query/DelegationRewards RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: delegator_address - description: delegator_address defines the delegator address to query for. - in: path - required: true - type: string - - name: validator_address - description: validator_address defines the validator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/delegators/{delegator_address}/validators: - get: - summary: DelegatorValidators queries the validators of a delegator. - operationId: CosmosDistributionV1Beta1DelegatorValidators - responses: - '200': - description: A successful response. - schema: - type: object - properties: - validators: - type: array - items: - type: string - description: >- - validators defines the validators a delegator is delegating - for. - description: |- - QueryDelegatorValidatorsResponse is the response type for the - Query/DelegatorValidators RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: delegator_address - description: delegator_address defines the delegator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address: - get: - summary: DelegatorWithdrawAddress queries withdraw address of a delegator. - operationId: CosmosDistributionV1Beta1DelegatorWithdrawAddress - responses: - '200': - description: A successful response. - schema: - type: object - properties: - withdraw_address: - type: string - description: withdraw_address defines the delegator address to query for. - description: |- - QueryDelegatorWithdrawAddressResponse is the response type for the - Query/DelegatorWithdrawAddress RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: delegator_address - description: delegator_address defines the delegator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/params: - get: - summary: Params queries params of the distribution module. - operationId: CosmosDistributionV1Beta1Params - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - description: params defines the parameters of the module. - type: object - properties: - community_tax: - type: string - base_proposer_reward: - type: string - description: >- - Deprecated: The base_proposer_reward field is deprecated - and is no longer used - - in the x/distribution module's reward mechanism. - bonus_proposer_reward: - type: string - description: >- - Deprecated: The bonus_proposer_reward field is deprecated - and is no longer used - - in the x/distribution module's reward mechanism. - withdraw_addr_enabled: - type: boolean - description: >- - QueryParamsResponse is the response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /cosmos/distribution/v1beta1/validators/{validator_address}: - get: - summary: >- - ValidatorDistributionInfo queries validator commission and - self-delegation rewards for validator - operationId: CosmosDistributionV1Beta1ValidatorDistributionInfo - responses: - '200': - description: A successful response. - schema: - type: object - properties: - operator_address: - type: string - description: operator_address defines the validator operator address. - self_bond_rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - description: self_bond_rewards defines the self delegations rewards. - commission: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - description: commission defines the commission the validator received. - description: >- - QueryValidatorDistributionInfoResponse is the response type for - the Query/ValidatorDistributionInfo RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: validator_address - description: validator_address defines the validator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/validators/{validator_address}/commission: - get: - summary: ValidatorCommission queries accumulated commission for a validator. - operationId: CosmosDistributionV1Beta1ValidatorCommission - responses: - '200': - description: A successful response. - schema: - type: object - properties: - commission: - description: commission defines the commission the validator received. - type: object - properties: - commission: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a - decimal amount. - - - NOTE: The amount field is an Dec which implements the - custom method - - signatures required by gogoproto. - title: |- - QueryValidatorCommissionResponse is the response type for the - Query/ValidatorCommission RPC method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: validator_address - description: validator_address defines the validator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards: - get: - summary: ValidatorOutstandingRewards queries rewards of a validator address. - operationId: CosmosDistributionV1Beta1ValidatorOutstandingRewards - responses: - '200': - description: A successful response. - schema: - type: object - properties: - rewards: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a - decimal amount. - - - NOTE: The amount field is an Dec which implements the - custom method - - signatures required by gogoproto. - description: >- - ValidatorOutstandingRewards represents outstanding - (un-withdrawn) rewards - - for a validator inexpensive to track, allows simple sanity - checks. - description: >- - QueryValidatorOutstandingRewardsResponse is the response type for - the - - Query/ValidatorOutstandingRewards RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: validator_address - description: validator_address defines the validator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/validators/{validator_address}/slashes: - get: - summary: ValidatorSlashes queries slash events of a validator. - operationId: CosmosDistributionV1Beta1ValidatorSlashes - responses: - '200': - description: A successful response. - schema: - type: object - properties: - slashes: - type: array - items: - type: object - properties: - validator_period: - type: string - format: uint64 - fraction: - type: string - description: >- - ValidatorSlashEvent represents a validator slash event. - - Height is implicit within the store key. - - This is needed to calculate appropriate amount of staking - tokens - - for delegations which are withdrawn after a slash has - occurred. - description: slashes defines the slashes the validator received. - 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: |- - QueryValidatorSlashesResponse is the response type for the - Query/ValidatorSlashes RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: validator_address - description: validator_address defines the validator address to query for. - in: path - required: true - type: string - - name: starting_height - description: >- - starting_height defines the optional starting height to query the - slashes. - in: query - required: false - type: string - format: uint64 - - name: ending_height - description: >- - starting_height defines the optional ending height to query the - slashes. - in: query - required: false - type: string - format: uint64 - - 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/evidence/v1beta1/evidence: - get: - summary: AllEvidence queries all evidence. - operationId: CosmosEvidenceV1Beta1AllEvidence - responses: - '200': - description: A successful response. - schema: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: evidence returns all evidences. - 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: >- - QueryAllEvidenceResponse is the response type for the - Query/AllEvidence RPC - - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - 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/evidence/v1beta1/evidence/{hash}: - get: - summary: Evidence queries evidence based on evidence hash. - operationId: CosmosEvidenceV1Beta1Evidence - responses: - '200': - description: A successful response. - schema: - type: object - properties: - evidence: - description: evidence returns the requested evidence. - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - QueryEvidenceResponse is the response type for the Query/Evidence - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: hash - description: |- - hash defines the evidence hash of the requested evidence. - - Since: cosmos-sdk 0.47 - in: path - required: true - type: string - - name: evidence_hash - description: |- - evidence_hash defines the hash of the requested evidence. - Deprecated: Use hash, a HEX encoded string, instead. - in: query - required: false - type: string - format: byte - tags: - - Query - /cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}: - get: - summary: Allowance returns fee granted to the grantee by the granter. - operationId: CosmosFeegrantV1Beta1Allowance - responses: - '200': - description: A successful response. - schema: - type: object - properties: - allowance: - description: allowance is a allowance granted for grantee by granter. - type: object - properties: - granter: - type: string - description: >- - granter is the address of the user granting an allowance - of their funds. - grantee: - type: string - description: >- - grantee is the address of the user being granted an - allowance of another user's funds. - allowance: - description: >- - allowance can be any of basic, periodic, allowed fee - allowance. - type: object - properties: - '@type': - 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. - additionalProperties: {} - title: >- - Grant is stored in the KVStore to record a grant with full - context - description: >- - QueryAllowanceResponse is the response type for the - Query/Allowance RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: granter - description: >- - granter is the address of the user granting an allowance of their - funds. - in: path - required: true - type: string - - name: grantee - description: >- - grantee is the address of the user being granted an allowance of - another user's funds. - in: path - required: true - type: string - tags: - - Query - /cosmos/feegrant/v1beta1/allowances/{grantee}: - get: - summary: Allowances returns all the grants for address. - operationId: CosmosFeegrantV1Beta1Allowances - responses: - '200': - description: A successful response. - schema: - type: object - properties: - allowances: - type: array - items: - type: object - properties: - granter: - type: string - description: >- - granter is the address of the user granting an allowance - of their funds. - grantee: - type: string - description: >- - grantee is the address of the user being granted an - allowance of another user's funds. - allowance: - description: >- - allowance can be any of basic, periodic, allowed fee - allowance. - type: object - properties: - '@type': - 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. - additionalProperties: {} - title: >- - Grant is stored in the KVStore to record a grant with full - context - description: allowances are allowance's granted for grantee by granter. - pagination: - description: pagination defines an pagination for 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: >- - QueryAllowancesResponse is the response type for the - Query/Allowances RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: grantee - in: path - required: true - 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 - type: boolean - tags: - - Query - /cosmos/feegrant/v1beta1/issued/{granter}: - get: - summary: AllowancesByGranter returns all the grants given by an address - description: 'Since: cosmos-sdk 0.46' - operationId: CosmosFeegrantV1Beta1AllowancesByGranter - responses: - '200': - description: A successful response. - schema: - type: object - properties: - allowances: - type: array - items: - type: object - properties: - granter: - type: string - description: >- - granter is the address of the user granting an allowance - of their funds. - grantee: - type: string - description: >- - grantee is the address of the user being granted an - allowance of another user's funds. - allowance: - description: >- - allowance can be any of basic, periodic, allowed fee - allowance. - type: object - properties: - '@type': - 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. - additionalProperties: {} - title: >- - Grant is stored in the KVStore to record a grant with full - context - description: allowances that have been issued by the granter. - pagination: - description: pagination defines an pagination for 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: >- - QueryAllowancesByGranterResponse is the response type for the - Query/AllowancesByGranter RPC method. - - - Since: cosmos-sdk 0.46 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: granter - in: path - required: true - 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 - type: boolean - tags: - - Query - /cosmos/gov/v1/params/{params_type}: - get: - summary: Params queries all parameters of the gov module. - operationId: CosmosGovV1Params - responses: - '200': - description: A successful response. - schema: - type: object - properties: - voting_params: - description: |- - Deprecated: Prefer to use `params` instead. - voting_params defines the parameters related to voting. - type: object - properties: - voting_period: - type: string - description: Duration of the voting period. - deposit_params: - description: |- - Deprecated: Prefer to use `params` instead. - deposit_params defines the parameters related to deposit. - type: object - properties: - min_deposit: - type: array - items: - 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: Minimum deposit for a proposal to enter voting period. - max_deposit_period: - type: string - description: >- - Maximum period for Atom holders to deposit on a proposal. - Initial value: 2 - - months. - tally_params: - description: |- - Deprecated: Prefer to use `params` instead. - tally_params defines the parameters related to tally. - type: object - properties: - quorum: - type: string - description: >- - Minimum percentage of total stake needed to vote for a - result to be - - considered valid. - threshold: - type: string - description: >- - Minimum proportion of Yes votes for proposal to pass. - Default value: 0.5. - veto_threshold: - type: string - description: >- - Minimum value of Veto votes to Total votes ratio for - proposal to be - - vetoed. Default value: 1/3. - params: - description: |- - params defines all the paramaters of x/gov module. - - Since: cosmos-sdk 0.47 - type: object - properties: - min_deposit: - type: array - items: - 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: Minimum deposit for a proposal to enter voting period. - max_deposit_period: - type: string - description: >- - Maximum period for Atom holders to deposit on a proposal. - Initial value: 2 - - months. - voting_period: - type: string - description: Duration of the voting period. - quorum: - type: string - description: >- - Minimum percentage of total stake needed to vote for a - result to be - considered valid. - threshold: - type: string - description: >- - Minimum proportion of Yes votes for proposal to pass. - Default value: 0.5. - veto_threshold: - type: string - description: >- - Minimum value of Veto votes to Total votes ratio for - proposal to be - vetoed. Default value: 1/3. - min_initial_deposit_ratio: - type: string - description: >- - The ratio representing the proportion of the deposit value - that must be paid at proposal submission. - burn_vote_quorum: - type: boolean - title: burn deposits if a proposal does not meet quorum - burn_proposal_deposit_prevote: - type: boolean - title: burn deposits if the proposal does not enter voting period - burn_vote_veto: - type: boolean - title: burn deposits if quorum with vote type no_veto is met - description: >- - QueryParamsResponse is the response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: params_type - description: >- - params_type defines which parameters to query for, can be one of - "voting", - - "tallying" or "deposit". - in: path - required: true - type: string - tags: - - Query - /cosmos/gov/v1/proposals: - get: - summary: Proposals queries all proposals based on given status. - operationId: CosmosGovV1Proposals - responses: - '200': - description: A successful response. - schema: - type: object - properties: - proposals: - type: array - items: - type: object - properties: - id: - type: string - format: uint64 - description: id defines the unique id of the proposal. - messages: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods - of the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL - and the unpack - - methods only use the fully qualified type name after - the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message - [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - messages are the arbitrary messages to be executed if - the proposal passes. - status: - description: status defines the proposal status. - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - final_tally_result: - description: >- - final_tally_result is the final tally result of the - proposal. When - - querying a proposal via gRPC, this field is not - populated until the - - proposal's voting period has ended. - type: object - properties: - yes_count: - type: string - description: yes_count is the number of yes votes on a proposal. - abstain_count: - type: string - description: >- - abstain_count is the number of abstain votes on a - proposal. - no_count: - type: string - description: no_count is the number of no votes on a proposal. - no_with_veto_count: - type: string - description: >- - no_with_veto_count is the number of no with veto - votes on a proposal. - submit_time: - type: string - format: date-time - description: submit_time is the time of proposal submission. - deposit_end_time: - type: string - format: date-time - description: deposit_end_time is the end time for deposition. - total_deposit: - type: array - items: - 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: total_deposit is the total deposit on the proposal. - voting_start_time: - type: string - format: date-time - description: >- - voting_start_time is the starting time to vote on a - proposal. - voting_end_time: - type: string - format: date-time - description: voting_end_time is the end time of voting on a proposal. - metadata: - type: string - description: >- - metadata is any arbitrary metadata attached to the - proposal. - title: - type: string - description: 'Since: cosmos-sdk 0.47' - title: title is the title of the proposal - summary: - type: string - description: 'Since: cosmos-sdk 0.47' - title: summary is a short summary of the proposal - proposer: - type: string - description: 'Since: cosmos-sdk 0.47' - title: Proposer is the address of the proposal sumbitter - description: >- - Proposal defines the core field members of a governance - proposal. - description: proposals defines all the requested governance proposals. - 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: >- - QueryProposalsResponse is the response type for the - Query/Proposals RPC - - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: proposal_status - description: |- - proposal_status defines the status of the proposals. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. - in: query - required: false - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - - name: voter - description: voter defines the voter address for the proposals. - in: query - required: false - type: string - - name: depositor - description: depositor defines the deposit addresses from the proposals. - 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 - type: boolean - tags: - - Query - /cosmos/gov/v1/proposals/{proposal_id}: - get: - summary: Proposal queries proposal details based on ProposalID. - operationId: CosmosGovV1Proposal - responses: - '200': - description: A successful response. - schema: - type: object - properties: - proposal: - description: proposal is the requested governance proposal. - type: object - properties: - id: - type: string - format: uint64 - description: id defines the unique id of the proposal. - messages: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message - [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - messages are the arbitrary messages to be executed if the - proposal passes. - status: - description: status defines the proposal status. - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - final_tally_result: - description: >- - final_tally_result is the final tally result of the - proposal. When - - querying a proposal via gRPC, this field is not populated - until the - - proposal's voting period has ended. - type: object - properties: - yes_count: - type: string - description: yes_count is the number of yes votes on a proposal. - abstain_count: - type: string - description: >- - abstain_count is the number of abstain votes on a - proposal. - no_count: - type: string - description: no_count is the number of no votes on a proposal. - no_with_veto_count: - type: string - description: >- - no_with_veto_count is the number of no with veto votes - on a proposal. - submit_time: - type: string - format: date-time - description: submit_time is the time of proposal submission. - deposit_end_time: - type: string - format: date-time - description: deposit_end_time is the end time for deposition. - total_deposit: - type: array - items: - 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: total_deposit is the total deposit on the proposal. - voting_start_time: - type: string - format: date-time - description: >- - voting_start_time is the starting time to vote on a - proposal. - voting_end_time: - type: string - format: date-time - description: voting_end_time is the end time of voting on a proposal. - metadata: - type: string - description: >- - metadata is any arbitrary metadata attached to the - proposal. - title: - type: string - description: 'Since: cosmos-sdk 0.47' - title: title is the title of the proposal - summary: - type: string - description: 'Since: cosmos-sdk 0.47' - title: summary is a short summary of the proposal - proposer: - type: string - description: 'Since: cosmos-sdk 0.47' - title: Proposer is the address of the proposal sumbitter - description: >- - QueryProposalResponse is the response type for the Query/Proposal - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. - in: path - required: true - type: string - format: uint64 - tags: - - Query - /cosmos/gov/v1/proposals/{proposal_id}/deposits: - get: - summary: Deposits queries all deposits of a single proposal. - operationId: CosmosGovV1Deposits - responses: - '200': - description: A successful response. - schema: - type: object - properties: - deposits: - type: array - items: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - depositor: - type: string - description: >- - depositor defines the deposit addresses from the - proposals. - amount: - type: array - items: - 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: amount to be deposited by depositor. - description: >- - Deposit defines an amount deposited by an account address to - an active - - proposal. - description: deposits defines the requested deposits. - 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: >- - QueryDepositsResponse is the response type for the Query/Deposits - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. - in: path - required: true - type: string - format: uint64 - - 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/gov/v1/proposals/{proposal_id}/deposits/{depositor}: - get: - summary: >- - Deposit queries single deposit information based proposalID, - depositAddr. - operationId: CosmosGovV1Deposit - responses: - '200': - description: A successful response. - schema: - type: object - properties: - deposit: - description: deposit defines the requested deposit. - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - depositor: - type: string - description: >- - depositor defines the deposit addresses from the - proposals. - amount: - type: array - items: - 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: amount to be deposited by depositor. - description: >- - QueryDepositResponse is the response type for the Query/Deposit - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. - in: path - required: true - type: string - format: uint64 - - name: depositor - description: depositor defines the deposit addresses from the proposals. - in: path - required: true - type: string - tags: - - Query - /cosmos/gov/v1/proposals/{proposal_id}/tally: - get: - summary: TallyResult queries the tally of a proposal vote. - operationId: CosmosGovV1TallyResult - responses: - '200': - description: A successful response. - schema: - type: object - properties: - tally: - description: tally defines the requested tally. - type: object - properties: - yes_count: - type: string - description: yes_count is the number of yes votes on a proposal. - abstain_count: - type: string - description: >- - abstain_count is the number of abstain votes on a - proposal. - no_count: - type: string - description: no_count is the number of no votes on a proposal. - no_with_veto_count: - type: string - description: >- - no_with_veto_count is the number of no with veto votes on - a proposal. - description: >- - QueryTallyResultResponse is the response type for the Query/Tally - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. - in: path - required: true - type: string - format: uint64 - tags: - - Query - /cosmos/gov/v1/proposals/{proposal_id}/votes: - get: - summary: Votes queries votes of a given proposal. - operationId: CosmosGovV1Votes - responses: - '200': - description: A successful response. - schema: - type: object - properties: - votes: - type: array - items: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - voter: - type: string - description: voter is the voter address of the proposal. - options: - type: array - items: - type: object - properties: - option: - description: >- - option defines the valid vote options, it must not - contain duplicate vote options. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - weight: - type: string - description: >- - weight is the vote weight associated with the vote - option. - description: >- - WeightedVoteOption defines a unit of vote for vote - split. - description: options is the weighted vote options. - metadata: - type: string - description: >- - metadata is any arbitrary metadata to attached to the - vote. - description: >- - Vote defines a vote on a governance proposal. - - A Vote consists of a proposal ID, the voter, and the vote - option. - description: votes defines the queried votes. - 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: >- - QueryVotesResponse is the response type for the Query/Votes RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. - in: path - required: true - type: string - format: uint64 - - 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/gov/v1/proposals/{proposal_id}/votes/{voter}: - get: - summary: Vote queries voted information based on proposalID, voterAddr. - operationId: CosmosGovV1Vote - responses: - '200': - description: A successful response. - schema: - type: object - properties: - vote: - description: vote defines the queried vote. - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - voter: - type: string - description: voter is the voter address of the proposal. - options: - type: array - items: - type: object - properties: - option: - description: >- - option defines the valid vote options, it must not - contain duplicate vote options. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - weight: - type: string - description: >- - weight is the vote weight associated with the vote - option. - description: >- - WeightedVoteOption defines a unit of vote for vote - split. - description: options is the weighted vote options. - metadata: - type: string - description: >- - metadata is any arbitrary metadata to attached to the - vote. - description: >- - QueryVoteResponse is the response type for the Query/Vote RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. - in: path - required: true - type: string - format: uint64 - - name: voter - description: voter defines the voter address for the proposals. - in: path - required: true - type: string - tags: - - Query - /cosmos/gov/v1beta1/params/{params_type}: - get: - summary: Params queries all parameters of the gov module. - operationId: CosmosGovV1Beta1Params - responses: - '200': - description: A successful response. - schema: - type: object - properties: - voting_params: - description: voting_params defines the parameters related to voting. - type: object - properties: - voting_period: - type: string - description: Duration of the voting period. - deposit_params: - description: deposit_params defines the parameters related to deposit. - type: object - properties: - min_deposit: - type: array - items: - 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: Minimum deposit for a proposal to enter voting period. - max_deposit_period: - type: string - description: >- - Maximum period for Atom holders to deposit on a proposal. - Initial value: 2 - - months. - tally_params: - description: tally_params defines the parameters related to tally. - type: object - properties: - quorum: - type: string - format: byte - description: >- - Minimum percentage of total stake needed to vote for a - result to be - - considered valid. - threshold: - type: string - format: byte - description: >- - Minimum proportion of Yes votes for proposal to pass. - Default value: 0.5. - veto_threshold: - type: string - format: byte - description: >- - Minimum value of Veto votes to Total votes ratio for - proposal to be - - vetoed. Default value: 1/3. - description: >- - QueryParamsResponse is the response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: params_type - description: >- - params_type defines which parameters to query for, can be one of - "voting", - - "tallying" or "deposit". - in: path - required: true - type: string - tags: - - Query - /cosmos/gov/v1beta1/proposals: - get: - summary: Proposals queries all proposals based on given status. - operationId: CosmosGovV1Beta1Proposals - responses: - '200': - description: A successful response. - schema: - type: object - properties: - proposals: - type: array - items: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - content: - description: content is the proposal's content. - type: object - properties: - '@type': - 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. - additionalProperties: {} - status: - description: status defines the proposal status. - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - final_tally_result: - description: >- - final_tally_result is the final tally result of the - proposal. When - - querying a proposal via gRPC, this field is not - populated until the - - proposal's voting period has ended. - type: object - properties: - 'yes': - type: string - description: yes is the number of yes votes on a proposal. - abstain: - type: string - description: >- - abstain is the number of abstain votes on a - proposal. - 'no': - type: string - description: no is the number of no votes on a proposal. - no_with_veto: - type: string - description: >- - no_with_veto is the number of no with veto votes on - a proposal. - submit_time: - type: string - format: date-time - description: submit_time is the time of proposal submission. - deposit_end_time: - type: string - format: date-time - description: deposit_end_time is the end time for deposition. - total_deposit: - type: array - items: - 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: total_deposit is the total deposit on the proposal. - voting_start_time: - type: string - format: date-time - description: >- - voting_start_time is the starting time to vote on a - proposal. - voting_end_time: - type: string - format: date-time - description: voting_end_time is the end time of voting on a proposal. - description: >- - Proposal defines the core field members of a governance - proposal. - description: proposals defines all the requested governance proposals. - 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: >- - QueryProposalsResponse is the response type for the - Query/Proposals RPC - - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: proposal_status - description: |- - proposal_status defines the status of the proposals. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. - in: query - required: false - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - - name: voter - description: voter defines the voter address for the proposals. - in: query - required: false - type: string - - name: depositor - description: depositor defines the deposit addresses from the proposals. - 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 - type: boolean - tags: - - Query - /cosmos/gov/v1beta1/proposals/{proposal_id}: - get: - summary: Proposal queries proposal details based on ProposalID. - operationId: CosmosGovV1Beta1Proposal - responses: - '200': - description: A successful response. - schema: - type: object - properties: - proposal: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - content: - description: content is the proposal's content. - type: object - properties: - '@type': - 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. - additionalProperties: {} - status: - description: status defines the proposal status. - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - final_tally_result: - description: >- - final_tally_result is the final tally result of the - proposal. When - - querying a proposal via gRPC, this field is not populated - until the - - proposal's voting period has ended. - type: object - properties: - 'yes': - type: string - description: yes is the number of yes votes on a proposal. - abstain: - type: string - description: abstain is the number of abstain votes on a proposal. - 'no': - type: string - description: no is the number of no votes on a proposal. - no_with_veto: - type: string - description: >- - no_with_veto is the number of no with veto votes on a - proposal. - submit_time: - type: string - format: date-time - description: submit_time is the time of proposal submission. - deposit_end_time: - type: string - format: date-time - description: deposit_end_time is the end time for deposition. - total_deposit: - type: array - items: - 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: total_deposit is the total deposit on the proposal. - voting_start_time: - type: string - format: date-time - description: >- - voting_start_time is the starting time to vote on a - proposal. - voting_end_time: - type: string - format: date-time - description: voting_end_time is the end time of voting on a proposal. - description: >- - Proposal defines the core field members of a governance - proposal. - description: >- - QueryProposalResponse is the response type for the Query/Proposal - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. - in: path - required: true - type: string - format: uint64 - tags: - - Query - /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits: - get: - summary: Deposits queries all deposits of a single proposal. - operationId: CosmosGovV1Beta1Deposits - responses: - '200': - description: A successful response. - schema: - type: object - properties: - deposits: - type: array - items: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - depositor: - type: string - description: >- - depositor defines the deposit addresses from the - proposals. - amount: - type: array - items: - 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: amount to be deposited by depositor. - description: >- - Deposit defines an amount deposited by an account address to - an active - - proposal. - description: deposits defines the requested deposits. - 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: >- - QueryDepositsResponse is the response type for the Query/Deposits - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. - in: path - required: true - type: string - format: uint64 - - 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/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}: - get: - summary: >- - Deposit queries single deposit information based proposalID, - depositAddr. - operationId: CosmosGovV1Beta1Deposit - responses: - '200': - description: A successful response. - schema: - type: object - properties: - deposit: - description: deposit defines the requested deposit. - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - depositor: - type: string - description: >- - depositor defines the deposit addresses from the - proposals. - amount: - type: array - items: - 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: amount to be deposited by depositor. - description: >- - QueryDepositResponse is the response type for the Query/Deposit - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. - in: path - required: true - type: string - format: uint64 - - name: depositor - description: depositor defines the deposit addresses from the proposals. - in: path - required: true - type: string - tags: - - Query - /cosmos/gov/v1beta1/proposals/{proposal_id}/tally: - get: - summary: TallyResult queries the tally of a proposal vote. - operationId: CosmosGovV1Beta1TallyResult - responses: - '200': - description: A successful response. - schema: - type: object - properties: - tally: - description: tally defines the requested tally. - type: object - properties: - 'yes': - type: string - description: yes is the number of yes votes on a proposal. - abstain: - type: string - description: abstain is the number of abstain votes on a proposal. - 'no': - type: string - description: no is the number of no votes on a proposal. - no_with_veto: - type: string - description: >- - no_with_veto is the number of no with veto votes on a - proposal. - description: >- - QueryTallyResultResponse is the response type for the Query/Tally - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. - in: path - required: true - type: string - format: uint64 - tags: - - Query - /cosmos/gov/v1beta1/proposals/{proposal_id}/votes: - get: - summary: Votes queries votes of a given proposal. - operationId: CosmosGovV1Beta1Votes - responses: - '200': - description: A successful response. - schema: - type: object - properties: - votes: - type: array - items: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - voter: - type: string - description: voter is the voter address of the proposal. - option: - description: >- - Deprecated: Prefer to use `options` instead. This field - is set in queries - - if and only if `len(options) == 1` and that option has - weight 1. In all - - other cases, this field will default to - VOTE_OPTION_UNSPECIFIED. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - options: - type: array - items: - type: object - properties: - option: - description: >- - option defines the valid vote options, it must not - contain duplicate vote options. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - weight: - type: string - description: >- - weight is the vote weight associated with the vote - option. - description: >- - WeightedVoteOption defines a unit of vote for vote - split. - - - Since: cosmos-sdk 0.43 - description: |- - options is the weighted vote options. - - Since: cosmos-sdk 0.43 - description: >- - Vote defines a vote on a governance proposal. - - A Vote consists of a proposal ID, the voter, and the vote - option. - description: votes defines the queried votes. - 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: >- - QueryVotesResponse is the response type for the Query/Votes RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. - in: path - required: true - type: string - format: uint64 - - 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/gov/v1beta1/proposals/{proposal_id}/votes/{voter}: - get: - summary: Vote queries voted information based on proposalID, voterAddr. - operationId: CosmosGovV1Beta1Vote - responses: - '200': - description: A successful response. - schema: - type: object - properties: - vote: - description: vote defines the queried vote. - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - voter: - type: string - description: voter is the voter address of the proposal. - option: - description: >- - Deprecated: Prefer to use `options` instead. This field is - set in queries - - if and only if `len(options) == 1` and that option has - weight 1. In all - - other cases, this field will default to - VOTE_OPTION_UNSPECIFIED. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - options: - type: array - items: - type: object - properties: - option: - description: >- - option defines the valid vote options, it must not - contain duplicate vote options. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - weight: - type: string - description: >- - weight is the vote weight associated with the vote - option. - description: >- - WeightedVoteOption defines a unit of vote for vote - split. - - - Since: cosmos-sdk 0.43 - description: |- - options is the weighted vote options. - - Since: cosmos-sdk 0.43 - description: >- - QueryVoteResponse is the response type for the Query/Vote RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. - in: path - required: true - type: string - format: uint64 - - name: voter - description: voter defines the voter address for the proposals. - in: path - required: true - type: string - tags: - - Query - /cosmos/mint/v1beta1/annual_provisions: - get: - summary: AnnualProvisions current minting annual provisions value. - operationId: CosmosMintV1Beta1AnnualProvisions - responses: - '200': - description: A successful response. - schema: - type: object - properties: - annual_provisions: - type: string - format: byte - description: >- - annual_provisions is the current minting annual provisions - value. - description: |- - QueryAnnualProvisionsResponse is the response type for the - Query/AnnualProvisions RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /cosmos/mint/v1beta1/inflation: - get: - summary: Inflation returns the current minting inflation value. - operationId: CosmosMintV1Beta1Inflation - responses: - '200': - description: A successful response. - schema: - type: object - properties: - inflation: - type: string - format: byte - description: inflation is the current minting inflation value. - description: >- - QueryInflationResponse is the response type for the - Query/Inflation RPC - - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /cosmos/mint/v1beta1/params: - get: - summary: Params returns the total set of minting parameters. - operationId: CosmosMintV1Beta1Params - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - description: params defines the parameters of the module. - type: object - properties: - mint_denom: - type: string - title: type of coin to mint - inflation_rate_change: - type: string - title: maximum annual change in inflation rate - inflation_max: - type: string - title: maximum inflation rate - inflation_min: - type: string - title: minimum inflation rate - goal_bonded: - type: string - title: goal of percent bonded atoms - blocks_per_year: - type: string - format: uint64 - title: expected blocks per year - description: >- - QueryParamsResponse is the response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /cosmos/nft/v1beta1/balance/{owner}/{class_id}: - get: - summary: >- - Balance queries the number of NFTs of a given class owned by the owner, - same as balanceOf in ERC721 - operationId: CosmosNftV1Beta1Balance - responses: - '200': - description: A successful response. - schema: - type: object - properties: - amount: - type: string - format: uint64 - title: >- - amount is the number of all NFTs of a given class owned by the - owner - title: >- - QueryBalanceResponse is the response type for the Query/Balance - RPC method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: owner - description: owner is the owner address of the nft - in: path - required: true - type: string - - name: class_id - description: class_id associated with the nft - in: path - required: true - type: string - tags: - - Query - /cosmos/nft/v1beta1/classes: - get: - summary: Classes queries all NFT classes - operationId: CosmosNftV1Beta1Classes - responses: - '200': - description: A successful response. - schema: - type: object - properties: - classes: - type: array - items: - type: object - properties: - id: - type: string - title: >- - id defines the unique identifier of the NFT - classification, similar to the contract address of - ERC721 - name: - type: string - title: >- - name defines the human-readable name of the NFT - classification. Optional - symbol: - type: string - title: >- - symbol is an abbreviated name for nft classification. - Optional - description: - type: string - title: >- - description is a brief description of nft - classification. Optional - uri: - type: string - title: >- - uri for the class metadata stored off chain. It can - define schema for Class and NFT `Data` attributes. - Optional - uri_hash: - type: string - title: >- - uri_hash is a hash of the document pointed by uri. - Optional - data: - title: >- - data is the app specific metadata of the NFT class. - Optional - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message - [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: Class defines the class of the nft type. - description: class defines the class of the nft type. - 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 - title: >- - QueryClassesResponse is the response type for the Query/Classes - RPC method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - 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/nft/v1beta1/classes/{class_id}: - get: - summary: Class queries an NFT class based on its id - operationId: CosmosNftV1Beta1Class - responses: - '200': - description: A successful response. - schema: - type: object - properties: - class: - description: class defines the class of the nft type. - type: object - properties: - id: - type: string - title: >- - id defines the unique identifier of the NFT - classification, similar to the contract address of ERC721 - name: - type: string - title: >- - name defines the human-readable name of the NFT - classification. Optional - symbol: - type: string - title: >- - symbol is an abbreviated name for nft classification. - Optional - description: - type: string - title: >- - description is a brief description of nft classification. - Optional - uri: - type: string - title: >- - uri for the class metadata stored off chain. It can define - schema for Class and NFT `Data` attributes. Optional - uri_hash: - type: string - title: >- - uri_hash is a hash of the document pointed by uri. - Optional - data: - title: >- - data is the app specific metadata of the NFT class. - Optional - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: >- - QueryClassResponse is the response type for the Query/Class RPC - method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: class_id - description: class_id associated with the nft - in: path - required: true - type: string - tags: - - Query - /cosmos/nft/v1beta1/nfts: - get: - summary: >- - NFTs queries all NFTs of a given class or owner,choose at least one of - the two, similar to tokenByIndex in - - ERC721Enumerable - operationId: CosmosNftV1Beta1NFTs - responses: - '200': - description: A successful response. - schema: - type: object - properties: - nfts: - type: array - items: - type: object - properties: - class_id: - type: string - title: >- - class_id associated with the NFT, similar to the - contract address of ERC721 - id: - type: string - title: id is a unique identifier of the NFT - uri: - type: string - title: uri for the NFT metadata stored off chain - uri_hash: - type: string - title: uri_hash is a hash of the document pointed by uri - data: - title: data is an app specific data of the NFT. Optional - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message - [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: NFT defines the NFT. - title: NFT defines the NFT - 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 - title: >- - QueryNFTsResponse is the response type for the Query/NFTs RPC - methods - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: class_id - description: class_id associated with the nft - in: query - required: false - type: string - - name: owner - description: owner is the owner address of the nft - 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 - type: boolean - tags: - - Query - /cosmos/nft/v1beta1/nfts/{class_id}/{id}: - get: - summary: NFT queries an NFT based on its class and id. - operationId: CosmosNftV1Beta1NFT - responses: - '200': - description: A successful response. - schema: - type: object - properties: - nft: - title: owner is the owner address of the nft - type: object - properties: - class_id: - type: string - title: >- - class_id associated with the NFT, similar to the contract - address of ERC721 - id: - type: string - title: id is a unique identifier of the NFT - uri: - type: string - title: uri for the NFT metadata stored off chain - uri_hash: - type: string - title: uri_hash is a hash of the document pointed by uri - data: - title: data is an app specific data of the NFT. Optional - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: NFT defines the NFT. - title: QueryNFTResponse is the response type for the Query/NFT RPC method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: class_id - description: class_id associated with the nft - in: path - required: true - type: string - - name: id - description: id is a unique identifier of the NFT - in: path - required: true - type: string - tags: - - Query - /cosmos/nft/v1beta1/owner/{class_id}/{id}: - get: - summary: >- - Owner queries the owner of the NFT based on its class and id, same as - ownerOf in ERC721 - operationId: CosmosNftV1Beta1Owner - responses: - '200': - description: A successful response. - schema: - type: object - properties: - owner: - type: string - title: owner is the owner address of the nft - title: >- - QueryOwnerResponse is the response type for the Query/Owner RPC - method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: class_id - description: class_id associated with the nft - in: path - required: true - type: string - - name: id - description: id is a unique identifier of the NFT - in: path - required: true - type: string - tags: - - Query - /cosmos/nft/v1beta1/supply/{class_id}: - get: - summary: >- - Supply queries the number of NFTs from the given class, same as - totalSupply of ERC721. - operationId: CosmosNftV1Beta1Supply - responses: - '200': - description: A successful response. - schema: - type: object - properties: - amount: - type: string - format: uint64 - title: amount is the number of all NFTs from the given class - title: >- - QuerySupplyResponse is the response type for the Query/Supply RPC - method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: class_id - description: class_id associated with the nft - in: path - required: true - type: string - tags: - - Query - /cosmos/params/v1beta1/params: - get: - summary: |- - Params queries a specific parameter of a module, given its subspace and - key. - operationId: CosmosParamsV1Beta1Params - responses: - '200': - description: A successful response. - schema: - type: object - properties: - param: - description: param defines the queried parameter. - type: object - properties: - subspace: - type: string - key: - type: string - value: - type: string - description: >- - QueryParamsResponse is response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: subspace - description: subspace defines the module to query the parameter for. - in: query - required: false - type: string - - name: key - description: key defines the key of the parameter in the subspace. - in: query - required: false - type: string - tags: - - Query - /cosmos/params/v1beta1/subspaces: - get: - summary: >- - Subspaces queries for all registered subspaces and all keys for a - subspace. - description: 'Since: cosmos-sdk 0.46' - operationId: CosmosParamsV1Beta1Subspaces - responses: - '200': - description: A successful response. - schema: - type: object - properties: - subspaces: - type: array - items: - type: object - properties: - subspace: - type: string - keys: - type: array - items: - type: string - description: >- - Subspace defines a parameter subspace name and all the keys - that exist for - - the subspace. - - - Since: cosmos-sdk 0.46 - description: >- - QuerySubspacesResponse defines the response types for querying for - all - - registered subspaces and all keys for a subspace. - - - Since: cosmos-sdk 0.46 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /cosmos/slashing/v1beta1/params: - get: - summary: Params queries the parameters of slashing module - operationId: CosmosSlashingV1Beta1Params - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - type: object - properties: - signed_blocks_window: - type: string - format: int64 - min_signed_per_window: - type: string - format: byte - downtime_jail_duration: - type: string - slash_fraction_double_sign: - type: string - format: byte - slash_fraction_downtime: - type: string - format: byte - description: >- - Params represents the parameters used for by the slashing - module. - title: >- - QueryParamsResponse is the response type for the Query/Params RPC - method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /cosmos/slashing/v1beta1/signing_infos: - get: - summary: SigningInfos queries signing info of all validators - operationId: CosmosSlashingV1Beta1SigningInfos - responses: - '200': - description: A successful response. - schema: - type: object - properties: - info: - type: array - items: - type: object - properties: - address: - type: string - start_height: - type: string - format: int64 - title: >- - Height at which validator was first a candidate OR was - unjailed - index_offset: - type: string - format: int64 - description: >- - Index which is incremented each time the validator was a - bonded - - in a block and may have signed a precommit or not. This - in conjunction with the - - `SignedBlocksWindow` param determines the index in the - `MissedBlocksBitArray`. - jailed_until: - type: string - format: date-time - description: >- - Timestamp until which the validator is jailed due to - liveness downtime. - tombstoned: - type: boolean - description: >- - 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 misbehiavor. - missed_blocks_counter: - type: string - format: int64 - description: >- - A counter kept to avoid unnecessary array reads. - - Note that `Sum(MissedBlocksBitArray)` always equals - `MissedBlocksCounter`. - description: >- - ValidatorSigningInfo defines a validator's signing info for - monitoring their - - liveness activity. - title: info is the signing info of all validators - pagination: - 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: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: >- - QuerySigningInfosResponse is the response type for the - Query/SigningInfos RPC - - method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - 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/slashing/v1beta1/signing_infos/{cons_address}: - get: - summary: SigningInfo queries the signing info of given cons address - operationId: CosmosSlashingV1Beta1SigningInfo - responses: - '200': - description: A successful response. - schema: - type: object - properties: - val_signing_info: - title: >- - val_signing_info is the signing info of requested val cons - address - type: object - properties: - address: - type: string - start_height: - type: string - format: int64 - title: >- - Height at which validator was first a candidate OR was - unjailed - index_offset: - type: string - format: int64 - description: >- - Index which is incremented each time the validator was a - bonded - - in a block and may have signed a precommit or not. This in - conjunction with the - - `SignedBlocksWindow` param determines the index in the - `MissedBlocksBitArray`. - jailed_until: - type: string - format: date-time - description: >- - Timestamp until which the validator is jailed due to - liveness downtime. - tombstoned: - type: boolean - description: >- - 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 misbehiavor. - missed_blocks_counter: - type: string - format: int64 - description: >- - A counter kept to avoid unnecessary array reads. - - Note that `Sum(MissedBlocksBitArray)` always equals - `MissedBlocksCounter`. - description: >- - ValidatorSigningInfo defines a validator's signing info for - monitoring their - - liveness activity. - title: >- - QuerySigningInfoResponse is the response type for the - Query/SigningInfo RPC - - method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: cons_address - description: cons_address is the address to query signing info of - in: path - required: true - type: string - tags: - - Query - /cosmos/staking/v1beta1/delegations/{delegator_addr}: - get: - summary: >- - DelegatorDelegations queries all delegations of a given delegator - address. - description: >- - When called from another module, this query might consume a high amount - of - - gas if the pagination field is incorrectly set. - operationId: CosmosStakingV1Beta1DelegatorDelegations - responses: - '200': - description: A successful response. - schema: - type: object - properties: - delegation_responses: - type: array - items: - type: object - properties: - delegation: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of - the delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of - the validator. - shares: - type: string - description: shares define the delegation shares received. - description: >- - Delegation represents the bond with tokens held by an - account. It is - - owned by one delegator, and is associated with the - voting power of one - - validator. - 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: >- - DelegationResponse is equivalent to Delegation except that - it contains a - - balance in addition to shares which is more suitable for - client responses. - description: >- - delegation_responses defines all the delegations' info of a - delegator. - 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: |- - QueryDelegatorDelegationsResponse is response type for the - Query/DelegatorDelegations RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: delegator_addr - description: delegator_addr defines the delegator address to query for. - in: path - required: true - 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 - type: boolean - tags: - - Query - /cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations: - get: - summary: Redelegations queries redelegations of given address. - description: >- - When called from another module, this query might consume a high amount - of - - gas if the pagination field is incorrectly set. - operationId: CosmosStakingV1Beta1Redelegations - responses: - '200': - description: A successful response. - schema: - type: object - properties: - redelegation_responses: - type: array - items: - type: object - properties: - redelegation: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of - the delegator. - validator_src_address: - type: string - description: >- - validator_src_address is the validator redelegation - source operator address. - validator_dst_address: - type: string - description: >- - validator_dst_address is the validator redelegation - destination operator address. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height defines the height which the - redelegation took place. - completion_time: - type: string - format: date-time - description: >- - completion_time defines the unix time for - redelegation completion. - initial_balance: - type: string - description: >- - initial_balance defines the initial balance - when redelegation started. - shares_dst: - type: string - description: >- - shares_dst is the amount of - destination-validator shares created by - redelegation. - unbonding_id: - type: string - format: uint64 - title: >- - Incrementing id that uniquely identifies this - entry - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - Strictly positive if this entry's unbonding - has been stopped by external modules - description: >- - RedelegationEntry defines a redelegation object - with relevant metadata. - description: |- - entries are the redelegation entries. - - redelegation entries - description: >- - Redelegation contains the list of a particular - delegator's redelegating bonds - - from a particular source validator to a particular - destination validator. - entries: - type: array - items: - type: object - properties: - redelegation_entry: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height defines the height which the - redelegation took place. - completion_time: - type: string - format: date-time - description: >- - completion_time defines the unix time for - redelegation completion. - initial_balance: - type: string - description: >- - initial_balance defines the initial balance - when redelegation started. - shares_dst: - type: string - description: >- - shares_dst is the amount of - destination-validator shares created by - redelegation. - unbonding_id: - type: string - format: uint64 - title: >- - Incrementing id that uniquely identifies this - entry - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - Strictly positive if this entry's unbonding - has been stopped by external modules - description: >- - RedelegationEntry defines a redelegation object - with relevant metadata. - balance: - type: string - description: >- - RedelegationEntryResponse is equivalent to a - RedelegationEntry except that it - - contains a balance in addition to shares which is more - suitable for client - - responses. - description: >- - RedelegationResponse is equivalent to a Redelegation except - that its entries - - contain a balance in addition to shares which is more - suitable for client - - responses. - 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: >- - QueryRedelegationsResponse is response type for the - Query/Redelegations RPC - - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: delegator_addr - description: delegator_addr defines the delegator address to query for. - in: path - required: true - type: string - - name: src_validator_addr - description: src_validator_addr defines the validator address to redelegate from. - in: query - required: false - type: string - - name: dst_validator_addr - description: dst_validator_addr defines the validator address to redelegate to. - 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 - type: boolean - tags: - - Query - /cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations: - get: - summary: >- - DelegatorUnbondingDelegations queries all unbonding delegations of a - given - - delegator address. - description: >- - When called from another module, this query might consume a high amount - of - - gas if the pagination field is incorrectly set. - operationId: CosmosStakingV1Beta1DelegatorUnbondingDelegations - responses: - '200': - description: A successful response. - schema: - type: object - properties: - unbonding_responses: - type: array - items: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height is the height which the unbonding - took place. - completion_time: - type: string - format: date-time - description: >- - completion_time is the unix time for unbonding - completion. - initial_balance: - type: string - description: >- - initial_balance defines the tokens initially - scheduled to receive at completion. - balance: - type: string - description: >- - balance defines the tokens to receive at - completion. - unbonding_id: - type: string - format: uint64 - title: >- - Incrementing id that uniquely identifies this - entry - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - Strictly positive if this entry's unbonding has - been stopped by external modules - description: >- - UnbondingDelegationEntry defines an unbonding object - with relevant metadata. - description: |- - entries are the unbonding delegation entries. - - unbonding delegation entries - description: >- - UnbondingDelegation stores all of a single delegator's - unbonding bonds - - for a single validator in an time-ordered list. - 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: >- - QueryUnbondingDelegatorDelegationsResponse is response type for - the - - Query/UnbondingDelegatorDelegations RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: delegator_addr - description: delegator_addr defines the delegator address to query for. - in: path - required: true - 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 - type: boolean - tags: - - Query - /cosmos/staking/v1beta1/delegators/{delegator_addr}/validators: - get: - summary: |- - DelegatorValidators queries all validators info for given delegator - address. - description: >- - When called from another module, this query might consume a high amount - of - - gas if the pagination field is incorrectly set. - operationId: CosmosStakingV1Beta1DelegatorValidators - responses: - '200': - description: A successful response. - schema: - type: object - properties: - validators: - type: array - items: - type: object - properties: - operator_address: - type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the - validator, as a Protobuf Any. - type: object - properties: - '@type': - 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. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed - from bonded status or not. - status: - description: >- - status is the validator status - (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: >- - tokens define the delegated tokens (incl. - self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a - validator's delegators. - description: - description: >- - description defines the description terms for the - validator. - type: object - properties: - moniker: - type: string - description: >- - moniker defines a human-readable name for the - validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. - UPort or Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for - security contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at - which this validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for - the validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission - rates to be used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to - delegators, as a fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate - which validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily - increase of the validator commission, as a - fraction. - update_time: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self declared - minimum self delegation. - - - Since: cosmos-sdk 0.46 - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - strictly positive if this validator's unbonding has been - stopped by external modules - unbonding_ids: - type: array - items: - type: string - format: uint64 - title: >- - list of unbonding ids, each uniquely identifing an - unbonding of this validator - description: >- - Validator defines a validator, together with the total - amount of the - - Validator's bond shares and their exchange rate to coins. - Slashing results in - - a decrease in the exchange rate, allowing correct - calculation of future - - undelegations without iterating over delegators. When coins - are delegated to - - this validator, the validator is credited with a delegation - whose number of - - bond shares is based on the amount of coins delegated - divided by the current - - exchange rate. Voting power can be calculated as total - bonded shares - - multiplied by exchange rate. - description: validators defines the validators' info of a delegator. - 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: |- - QueryDelegatorValidatorsResponse is response type for the - Query/DelegatorValidators RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: delegator_addr - description: delegator_addr defines the delegator address to query for. - in: path - required: true - 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 - type: boolean - tags: - - Query - /cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}: - get: - summary: |- - DelegatorValidator queries validator info for given delegator validator - pair. - operationId: CosmosStakingV1Beta1DelegatorValidator - responses: - '200': - description: A successful response. - schema: - type: object - properties: - validator: - description: validator defines the validator info. - type: object - properties: - operator_address: - type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the - validator, as a Protobuf Any. - type: object - properties: - '@type': - 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. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed from - bonded status or not. - status: - description: >- - status is the validator status - (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: >- - tokens define the delegated tokens (incl. - self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a - validator's delegators. - description: - description: >- - description defines the description terms for the - validator. - type: object - properties: - moniker: - type: string - description: >- - moniker defines a human-readable name for the - validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. - UPort or Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for - security contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at - which this validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for the - validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates - to be used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to delegators, - as a fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase - of the validator commission, as a fraction. - update_time: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self declared - minimum self delegation. - - - Since: cosmos-sdk 0.46 - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - strictly positive if this validator's unbonding has been - stopped by external modules - unbonding_ids: - type: array - items: - type: string - format: uint64 - title: >- - list of unbonding ids, each uniquely identifing an - unbonding of this validator - description: |- - QueryDelegatorValidatorResponse response type for the - Query/DelegatorValidator RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: delegator_addr - description: delegator_addr defines the delegator address to query for. - in: path - required: true - type: string - - name: validator_addr - description: validator_addr defines the validator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/staking/v1beta1/historical_info/{height}: - get: - summary: HistoricalInfo queries the historical info for given height. - operationId: CosmosStakingV1Beta1HistoricalInfo - responses: - '200': - description: A successful response. - schema: - type: object - properties: - hist: - description: hist defines the historical info at the given height. - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing - a block in the blockchain, - - including all blockchain data structures and the rules - of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs from the - previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - valset: - type: array - items: - type: object - properties: - operator_address: - type: string - description: >- - operator_address defines the address of the - validator's operator; bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the - validator, as a Protobuf Any. - type: object - properties: - '@type': - 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. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed - from bonded status or not. - status: - description: >- - status is the validator status - (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: >- - tokens define the delegated tokens (incl. - self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a - validator's delegators. - description: - description: >- - description defines the description terms for the - validator. - type: object - properties: - moniker: - type: string - description: >- - moniker defines a human-readable name for the - validator. - identity: - type: string - description: >- - identity defines an optional identity signature - (ex. UPort or Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for - security contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height - at which this validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time - for the validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission - rates to be used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to - delegators, as a fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate - which validator can ever charge, as a - fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily - increase of the validator commission, as a - fraction. - update_time: - type: string - format: date-time - description: >- - update_time is the last time the commission rate - was changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self declared - minimum self delegation. - - - Since: cosmos-sdk 0.46 - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - strictly positive if this validator's unbonding has - been stopped by external modules - unbonding_ids: - type: array - items: - type: string - format: uint64 - title: >- - list of unbonding ids, each uniquely identifing an - unbonding of this validator - description: >- - Validator defines a validator, together with the total - amount of the - - Validator's bond shares and their exchange rate to - coins. Slashing results in - - a decrease in the exchange rate, allowing correct - calculation of future - - undelegations without iterating over delegators. When - coins are delegated to - - this validator, the validator is credited with a - delegation whose number of - - bond shares is based on the amount of coins delegated - divided by the current - - exchange rate. Voting power can be calculated as total - bonded shares - - multiplied by exchange rate. - description: >- - QueryHistoricalInfoResponse is response type for the - Query/HistoricalInfo RPC - - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: height - description: height defines at which height to query the historical info. - in: path - required: true - type: string - format: int64 - tags: - - Query - /cosmos/staking/v1beta1/params: - get: - summary: Parameters queries the staking parameters. - operationId: CosmosStakingV1Beta1Params - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - properties: - unbonding_time: - type: string - description: unbonding_time is the time duration of unbonding. - max_validators: - type: integer - format: int64 - description: max_validators is the maximum number of validators. - max_entries: - type: integer - format: int64 - description: >- - max_entries is the max entries for either unbonding - delegation or redelegation (per pair/trio). - historical_entries: - type: integer - format: int64 - description: >- - historical_entries is the number of historical entries to - persist. - bond_denom: - type: string - description: bond_denom defines the bondable coin denomination. - min_commission_rate: - type: string - title: >- - min_commission_rate is the chain-wide minimum commission - rate that a validator can charge their delegators - description: >- - QueryParamsResponse is response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - tags: - - Query - /cosmos/staking/v1beta1/pool: - get: - summary: Pool queries the pool info. - operationId: CosmosStakingV1Beta1Pool - responses: - '200': - description: A successful response. - schema: - type: object - properties: - pool: - description: pool defines the pool info. - type: object - properties: - not_bonded_tokens: - type: string - bonded_tokens: - type: string - description: QueryPoolResponse is response type for the Query/Pool RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - tags: - - Query - /cosmos/staking/v1beta1/validators: - get: - summary: Validators queries all validators that match the given status. - description: >- - When called from another module, this query might consume a high amount - of - - gas if the pagination field is incorrectly set. - operationId: CosmosStakingV1Beta1Validators - responses: - '200': - description: A successful response. - schema: - type: object - properties: - validators: - type: array - items: - type: object - properties: - operator_address: - type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the - validator, as a Protobuf Any. - type: object - properties: - '@type': - 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. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed - from bonded status or not. - status: - description: >- - status is the validator status - (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: >- - tokens define the delegated tokens (incl. - self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a - validator's delegators. - description: - description: >- - description defines the description terms for the - validator. - type: object - properties: - moniker: - type: string - description: >- - moniker defines a human-readable name for the - validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. - UPort or Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for - security contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at - which this validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for - the validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission - rates to be used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to - delegators, as a fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate - which validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily - increase of the validator commission, as a - fraction. - update_time: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self declared - minimum self delegation. - - - Since: cosmos-sdk 0.46 - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - strictly positive if this validator's unbonding has been - stopped by external modules - unbonding_ids: - type: array - items: - type: string - format: uint64 - title: >- - list of unbonding ids, each uniquely identifing an - unbonding of this validator - description: >- - Validator defines a validator, together with the total - amount of the - - Validator's bond shares and their exchange rate to coins. - Slashing results in - - a decrease in the exchange rate, allowing correct - calculation of future - - undelegations without iterating over delegators. When coins - are delegated to - - this validator, the validator is credited with a delegation - whose number of - - bond shares is based on the amount of coins delegated - divided by the current - - exchange rate. Voting power can be calculated as total - bonded shares - - multiplied by exchange rate. - description: validators contains all the queried validators. - 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 - title: >- - QueryValidatorsResponse is response type for the Query/Validators - RPC method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: status - description: status enables to query for validators matching a given status. - 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 - type: boolean - tags: - - Query - /cosmos/staking/v1beta1/validators/{validator_addr}: - get: - summary: Validator queries validator info for given validator address. - operationId: CosmosStakingV1Beta1Validator - responses: - '200': - description: A successful response. - schema: - type: object - properties: - validator: - description: validator defines the validator info. - type: object - properties: - operator_address: - type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the - validator, as a Protobuf Any. - type: object - properties: - '@type': - 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. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed from - bonded status or not. - status: - description: >- - status is the validator status - (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: >- - tokens define the delegated tokens (incl. - self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a - validator's delegators. - description: - description: >- - description defines the description terms for the - validator. - type: object - properties: - moniker: - type: string - description: >- - moniker defines a human-readable name for the - validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. - UPort or Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for - security contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at - which this validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for the - validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates - to be used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to delegators, - as a fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase - of the validator commission, as a fraction. - update_time: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self declared - minimum self delegation. - - - Since: cosmos-sdk 0.46 - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - strictly positive if this validator's unbonding has been - stopped by external modules - unbonding_ids: - type: array - items: - type: string - format: uint64 - title: >- - list of unbonding ids, each uniquely identifing an - unbonding of this validator - title: >- - QueryValidatorResponse is response type for the Query/Validator - RPC method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: validator_addr - description: validator_addr defines the validator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/staking/v1beta1/validators/{validator_addr}/delegations: - get: - summary: ValidatorDelegations queries delegate info for given validator. - description: >- - When called from another module, this query might consume a high amount - of - - gas if the pagination field is incorrectly set. - operationId: CosmosStakingV1Beta1ValidatorDelegations - responses: - '200': - description: A successful response. - schema: - type: object - properties: - delegation_responses: - type: array - items: - type: object - properties: - delegation: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of - the delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of - the validator. - shares: - type: string - description: shares define the delegation shares received. - description: >- - Delegation represents the bond with tokens held by an - account. It is - - owned by one delegator, and is associated with the - voting power of one - - validator. - 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: >- - DelegationResponse is equivalent to Delegation except that - it contains a - - balance in addition to shares which is more suitable for - client responses. - 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 - title: |- - QueryValidatorDelegationsResponse is response type for the - Query/ValidatorDelegations RPC method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: validator_addr - description: validator_addr defines the validator address to query for. - in: path - required: true - 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 - type: boolean - tags: - - Query - /cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}: - get: - summary: Delegation queries delegate info for given validator delegator pair. - operationId: CosmosStakingV1Beta1Delegation - responses: - '200': - description: A successful response. - schema: - type: object - properties: - delegation_response: - description: >- - delegation_responses defines the delegation info of a - delegation. - type: object - properties: - delegation: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - shares: - type: string - description: shares define the delegation shares received. - description: >- - Delegation represents the bond with tokens held by an - account. It is - - owned by one delegator, and is associated with the voting - power of one - - validator. - 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: >- - QueryDelegationResponse is response type for the Query/Delegation - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: validator_addr - description: validator_addr defines the validator address to query for. - in: path - required: true - type: string - - name: delegator_addr - description: delegator_addr defines the delegator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation: - get: - summary: |- - UnbondingDelegation queries unbonding info for given validator delegator - pair. - operationId: CosmosStakingV1Beta1UnbondingDelegation - responses: - '200': - description: A successful response. - schema: - type: object - properties: - unbond: - description: unbond defines the unbonding information of a delegation. - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height is the height which the unbonding - took place. - completion_time: - type: string - format: date-time - description: >- - completion_time is the unix time for unbonding - completion. - initial_balance: - type: string - description: >- - initial_balance defines the tokens initially - scheduled to receive at completion. - balance: - type: string - description: balance defines the tokens to receive at completion. - unbonding_id: - type: string - format: uint64 - title: Incrementing id that uniquely identifies this entry - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - Strictly positive if this entry's unbonding has been - stopped by external modules - description: >- - UnbondingDelegationEntry defines an unbonding object - with relevant metadata. - description: |- - entries are the unbonding delegation entries. - - unbonding delegation entries - description: >- - QueryDelegationResponse is response type for the - Query/UnbondingDelegation - - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: validator_addr - description: validator_addr defines the validator address to query for. - in: path - required: true - type: string - - name: delegator_addr - description: delegator_addr defines the delegator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations: - get: - summary: >- - ValidatorUnbondingDelegations queries unbonding delegations of a - validator. - description: >- - When called from another module, this query might consume a high amount - of - - gas if the pagination field is incorrectly set. - operationId: CosmosStakingV1Beta1ValidatorUnbondingDelegations - responses: - '200': - description: A successful response. - schema: - type: object - properties: - unbonding_responses: - type: array - items: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height is the height which the unbonding - took place. - completion_time: - type: string - format: date-time - description: >- - completion_time is the unix time for unbonding - completion. - initial_balance: - type: string - description: >- - initial_balance defines the tokens initially - scheduled to receive at completion. - balance: - type: string - description: >- - balance defines the tokens to receive at - completion. - unbonding_id: - type: string - format: uint64 - title: >- - Incrementing id that uniquely identifies this - entry - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - Strictly positive if this entry's unbonding has - been stopped by external modules - description: >- - UnbondingDelegationEntry defines an unbonding object - with relevant metadata. - description: |- - entries are the unbonding delegation entries. - - unbonding delegation entries - description: >- - UnbondingDelegation stores all of a single delegator's - unbonding bonds - - for a single validator in an time-ordered list. - 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: >- - QueryValidatorUnbondingDelegationsResponse is response type for - the - - Query/ValidatorUnbondingDelegations RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: validator_addr - description: validator_addr defines the validator address to query for. - in: path - required: true - 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 - type: boolean - tags: - - Query - /cosmos/tx/v1beta1/decode: - post: - summary: TxDecode decodes the transaction. - description: 'Since: cosmos-sdk 0.47' - operationId: CosmosTxV1Beta1TxDecode - responses: - '200': - description: A successful response. - schema: - $ref: '#/definitions/cosmos.tx.v1beta1.TxDecodeResponse' - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: body - description: |- - TxDecodeRequest is the request type for the Service.TxDecode - RPC method. - - Since: cosmos-sdk 0.47 - in: body - required: true - schema: - type: object - properties: - tx_bytes: - type: string - format: byte - description: tx_bytes is the raw transaction. - description: |- - TxDecodeRequest is the request type for the Service.TxDecode - RPC method. - - Since: cosmos-sdk 0.47 - tags: - - Service - /cosmos/tx/v1beta1/decode/amino: - post: - summary: TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. - description: 'Since: cosmos-sdk 0.47' - operationId: CosmosTxV1Beta1TxDecodeAmino - responses: - '200': - description: A successful response. - schema: - type: object - properties: - amino_json: - type: string - description: >- - TxDecodeAminoResponse is the response type for the - Service.TxDecodeAmino - - RPC method. - - - Since: cosmos-sdk 0.47 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: body - description: >- - TxDecodeAminoRequest is the request type for the - Service.TxDecodeAmino - - RPC method. - - - Since: cosmos-sdk 0.47 - in: body - required: true - schema: - type: object - properties: - amino_binary: - type: string - format: byte - description: >- - TxDecodeAminoRequest is the request type for the - Service.TxDecodeAmino - - RPC method. - - - Since: cosmos-sdk 0.47 - tags: - - Service - /cosmos/tx/v1beta1/encode: - post: - summary: TxEncode encodes the transaction. - description: 'Since: cosmos-sdk 0.47' - operationId: CosmosTxV1Beta1TxEncode - responses: - '200': - description: A successful response. - schema: - type: object - properties: - tx_bytes: - type: string - format: byte - description: tx_bytes is the encoded transaction bytes. - description: |- - TxEncodeResponse is the response type for the - Service.TxEncode method. - - Since: cosmos-sdk 0.47 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: body - description: |- - TxEncodeRequest is the request type for the Service.TxEncode - RPC method. - - Since: cosmos-sdk 0.47 - in: body - required: true - schema: - $ref: '#/definitions/cosmos.tx.v1beta1.TxEncodeRequest' - tags: - - Service - /cosmos/tx/v1beta1/encode/amino: - post: - summary: TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. - description: 'Since: cosmos-sdk 0.47' - operationId: CosmosTxV1Beta1TxEncodeAmino - responses: - '200': - description: A successful response. - schema: - type: object - properties: - amino_binary: - type: string - format: byte - description: >- - TxEncodeAminoResponse is the response type for the - Service.TxEncodeAmino - - RPC method. - - - Since: cosmos-sdk 0.47 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: body - description: >- - TxEncodeAminoRequest is the request type for the - Service.TxEncodeAmino - - RPC method. - - - Since: cosmos-sdk 0.47 - in: body - required: true - schema: - type: object - properties: - amino_json: - type: string - description: >- - TxEncodeAminoRequest is the request type for the - Service.TxEncodeAmino - - RPC method. - - - Since: cosmos-sdk 0.47 - tags: - - Service - /cosmos/tx/v1beta1/simulate: - post: - summary: Simulate simulates executing a transaction for estimating gas usage. - operationId: CosmosTxV1Beta1Simulate - responses: - '200': - description: A successful response. - schema: - type: object - properties: - gas_info: - description: gas_info is the information about gas used in the simulation. - type: object - properties: - gas_wanted: - type: string - format: uint64 - description: >- - GasWanted is the maximum units of work we allow this tx to - perform. - gas_used: - type: string - format: uint64 - description: GasUsed is the amount of gas actually consumed. - result: - description: result is the result of the simulation. - type: object - properties: - data: - type: string - format: byte - description: >- - Data is any data returned from message or handler - execution. It MUST be - - length prefixed in order to separate data from multiple - message executions. - - Deprecated. This field is still populated, but prefer - msg_response instead - - because it also contains the Msg response typeURL. - log: - type: string - description: >- - Log contains the log information from message or handler - execution. - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - index: - type: boolean - title: nondeterministic - description: >- - EventAttribute is a single key-value pair, - associated with an event. - description: >- - Event allows application developers to attach additional - information to - - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx - and ResponseDeliverTx. - - Later, transactions may be queried using these events. - description: >- - Events contains a slice of Event objects that were emitted - during message - - or handler execution. - msg_responses: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message - [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - msg_responses contains the Msg handler responses type - packed in Anys. - - - Since: cosmos-sdk 0.46 - description: |- - SimulateResponse is the response type for the - Service.SimulateRPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: body - description: |- - SimulateRequest is the request type for the Service.Simulate - RPC method. - in: body - required: true - schema: - $ref: '#/definitions/cosmos.tx.v1beta1.SimulateRequest' - tags: - - Service - /cosmos/tx/v1beta1/txs: - get: - summary: GetTxsEvent fetches txs by event. - operationId: CosmosTxV1Beta1GetTxsEvent - responses: - '200': - description: A successful response. - schema: - $ref: '#/definitions/cosmos.tx.v1beta1.GetTxsEventResponse' - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: events - description: events is the list of transaction event type. - in: query - required: false - type: array - items: - type: string - collectionFormat: multi - - 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 - - name: order_by - description: |2- - - ORDER_BY_UNSPECIFIED: ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. - - ORDER_BY_ASC: ORDER_BY_ASC defines ascending order - - ORDER_BY_DESC: ORDER_BY_DESC defines descending order - in: query - required: false - type: string - enum: - - ORDER_BY_UNSPECIFIED - - ORDER_BY_ASC - - ORDER_BY_DESC - default: ORDER_BY_UNSPECIFIED - - name: page - description: >- - page is the page number to query, starts at 1. If not provided, will - default to first page. - in: query - required: false - type: string - format: uint64 - - name: 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 - tags: - - Service - post: - summary: BroadcastTx broadcast transaction. - operationId: CosmosTxV1Beta1BroadcastTx - responses: - '200': - description: A successful response. - schema: - type: object - properties: - tx_response: - description: tx_response is the queried TxResponses. - type: object - properties: - height: - type: string - format: int64 - title: The block height - txhash: - type: string - description: The transaction hash. - codespace: - type: string - title: Namespace for the Code - code: - type: integer - format: int64 - description: Response code. - data: - type: string - description: Result bytes, if any. - raw_log: - type: string - description: >- - The output of the application's logger (raw string). May - be - - non-deterministic. - logs: - type: array - items: - type: object - properties: - msg_index: - type: integer - format: int64 - log: - type: string - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - description: >- - Attribute defines an attribute wrapper where - the key and value are - - strings instead of raw bytes. - description: >- - StringEvent defines en Event object wrapper where - all the attributes - - contain key/value pairs that are strings instead - of raw bytes. - description: >- - Events contains a slice of Event objects that were - emitted during some - - execution. - description: >- - ABCIMessageLog defines a structure containing an indexed - tx ABCI message log. - description: >- - The output of the application's logger (typed). May be - non-deterministic. - info: - type: string - description: Additional information. May be non-deterministic. - gas_wanted: - type: string - format: int64 - description: Amount of gas requested for transaction. - gas_used: - type: string - format: int64 - description: Amount of gas consumed by transaction. - tx: - description: The request transaction bytes. - type: object - properties: - '@type': - 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. - additionalProperties: {} - timestamp: - type: string - description: >- - Time of the previous block. For heights > 1, it's the - weighted median of - - the timestamps of the valid votes in the block.LastCommit. - For height == 1, - - it's genesis time. - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - index: - type: boolean - title: nondeterministic - description: >- - EventAttribute is a single key-value pair, - associated with an event. - description: >- - Event allows application developers to attach additional - information to - - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx - and ResponseDeliverTx. - - Later, transactions may be queried using these events. - description: >- - Events defines all the events emitted by processing a - transaction. Note, - - these events include those emitted by processing all the - messages and those - - emitted from the ante. Whereas Logs contains the events, - with - - additional metadata, emitted only by processing the - messages. - - - Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - description: |- - BroadcastTxResponse is the response type for the - Service.BroadcastTx method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: body - description: >- - BroadcastTxRequest is the request type for the - Service.BroadcastTxRequest - - RPC method. - in: body - required: true - schema: - type: object - properties: - tx_bytes: - type: string - format: byte - description: tx_bytes is the raw transaction. - mode: - type: string - enum: - - BROADCAST_MODE_UNSPECIFIED - - BROADCAST_MODE_BLOCK - - BROADCAST_MODE_SYNC - - BROADCAST_MODE_ASYNC - default: BROADCAST_MODE_UNSPECIFIED - description: >- - BroadcastMode specifies the broadcast mode for the - TxService.Broadcast RPC method. - - - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering - - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, - BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x - onwards. - - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for - a CheckTx execution response only. - - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns - immediately. - description: >- - BroadcastTxRequest is the request type for the - Service.BroadcastTxRequest - - RPC method. - tags: - - Service - /cosmos/tx/v1beta1/txs/block/{height}: - get: - summary: GetBlockWithTxs fetches a block with decoded txs. - description: 'Since: cosmos-sdk 0.45.2' - operationId: CosmosTxV1Beta1GetBlockWithTxs - responses: - '200': - description: A successful response. - schema: - $ref: '#/definitions/cosmos.tx.v1beta1.GetBlockWithTxsResponse' - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: height - description: height is the height of the block to query. - in: path - required: true - type: string - format: int64 - - 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: - - Service - /cosmos/tx/v1beta1/txs/{hash}: - get: - summary: GetTx fetches a tx by hash. - operationId: CosmosTxV1Beta1GetTx - responses: - '200': - description: A successful response. - schema: - $ref: '#/definitions/cosmos.tx.v1beta1.GetTxResponse' - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: hash - description: hash is the tx hash to query, encoded as a hex string. - in: path - required: true - type: string - tags: - - Service - /cosmos/upgrade/v1beta1/applied_plan/{name}: - get: - summary: AppliedPlan queries a previously applied upgrade plan by its name. - operationId: CosmosUpgradeV1Beta1AppliedPlan - responses: - '200': - description: A successful response. - schema: - type: object - properties: - height: - type: string - format: int64 - description: height is the block height at which the plan was applied. - description: >- - QueryAppliedPlanResponse is the response type for the - Query/AppliedPlan RPC - - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: name - description: name is the name of the applied plan to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/upgrade/v1beta1/authority: - get: - summary: Returns the account with authority to conduct upgrades - description: 'Since: cosmos-sdk 0.46' - operationId: CosmosUpgradeV1Beta1Authority - responses: - '200': - description: A successful response. - schema: - type: object - properties: - address: - type: string - description: 'Since: cosmos-sdk 0.46' - title: QueryAuthorityResponse is the response type for Query/Authority - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - tags: - - Query - /cosmos/upgrade/v1beta1/current_plan: - get: - summary: CurrentPlan queries the current upgrade plan. - operationId: CosmosUpgradeV1Beta1CurrentPlan - responses: - '200': - description: A successful response. - schema: - type: object - properties: - plan: - description: plan is the current upgrade plan. - type: object - properties: - name: - type: string - description: >- - Sets the name for the upgrade. This name will be used by - the upgraded - - version of the software to apply any special "on-upgrade" - commands during - - the first BeginBlock method after the upgrade is applied. - It is also used - - to detect whether a software version can handle a given - upgrade. If no - - upgrade handler with this name has been set in the - software, it will be - - assumed that the software is out-of-date when the upgrade - Time or Height is - - reached and the software will exit. - time: - type: string - format: date-time - description: >- - Deprecated: Time based upgrades have been deprecated. Time - based upgrade logic - - has been removed from the SDK. - - If this field is not empty, an error will be thrown. - height: - type: string - format: int64 - description: The height at which the upgrade must be performed. - info: - type: string - title: >- - Any application specific upgrade info to be included - on-chain - - such as a git commit that validators could automatically - upgrade to - upgraded_client_state: - description: >- - Deprecated: UpgradedClientState field has been deprecated. - IBC upgrade logic has been - - moved to the IBC module in the sub module 02-client. - - If this field is not empty, an error will be thrown. - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - QueryCurrentPlanResponse is the response type for the - Query/CurrentPlan RPC - - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - tags: - - Query - /cosmos/upgrade/v1beta1/module_versions: - get: - summary: ModuleVersions queries the list of module versions from state. - description: 'Since: cosmos-sdk 0.43' - operationId: CosmosUpgradeV1Beta1ModuleVersions - responses: - '200': - description: A successful response. - schema: - type: object - properties: - module_versions: - type: array - items: - type: object - properties: - name: - type: string - title: name of the app module - version: - type: string - format: uint64 - title: consensus version of the app module - description: |- - ModuleVersion specifies a module and its consensus version. - - Since: cosmos-sdk 0.43 - description: >- - module_versions is a list of module names with their consensus - versions. - description: >- - QueryModuleVersionsResponse is the response type for the - Query/ModuleVersions - - RPC method. - - - Since: cosmos-sdk 0.43 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: module_name - description: |- - module_name is a field to query a specific module - consensus version from state. Leaving this empty will - fetch the full list of module versions from state - in: query - required: false - type: string - tags: - - Query - /cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}: - get: - summary: >- - UpgradedConsensusState queries the consensus state that will serve - - as a trusted kernel for the next version of this chain. It will only be - - stored at the last height of this chain. - - UpgradedConsensusState RPC not supported with legacy querier - - This rpc is deprecated now that IBC has its own replacement - - (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) - operationId: CosmosUpgradeV1Beta1UpgradedConsensusState - responses: - '200': - description: A successful response. - schema: - type: object - properties: - upgraded_consensus_state: - type: string - format: byte - title: 'Since: cosmos-sdk 0.43' - description: >- - QueryUpgradedConsensusStateResponse is the response type for the - Query/UpgradedConsensusState - - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: last_height - description: |- - last height of the current chain must be sent in request - as this is the height under which next consensus state is stored - in: path - required: true - type: string - format: int64 - tags: - - Query - /cosmos/fundraising/v1beta1/auctions: - get: - summary: Auctions returns all auctions. - operationId: FundraisingAuctions - responses: - '200': - description: A successful response. - schema: - type: object - properties: - auctions: - type: array - items: - type: object - properties: - '@type': - 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. As of May 2023, there are no widely - used type server - - implementations and no plans to implement one. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: auctions specifies the existing auctions - pagination: - title: 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: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - description: >- - QueryAuctionsResponse is response type for the Query/Auctions RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. As of May 2023, there are no widely - used type server - - implementations and no plans to implement one. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: status - in: query - required: false - type: string - - name: type - 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 - type: boolean - tags: - - Query - /cosmos/fundraising/v1beta1/auctions/{auction_id}: - get: - summary: Auction returns the specific auction. - operationId: FundraisingAuction - responses: - '200': - description: A successful response. - schema: - type: object - properties: - auction: - type: object - properties: - '@type': - 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. As of May 2023, there are no widely - used type server - - implementations and no plans to implement one. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - QueryAuctionResponse is the response type for the Query/Auction - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. As of May 2023, there are no widely - used type server - - implementations and no plans to implement one. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: auction_id - in: path - required: true - type: string - format: uint64 - tags: - - Query - /cosmos/fundraising/v1beta1/auctions/{auction_id}/allowed_bidders: - get: - summary: AllowedBidders returns all allowed bidders for the auction. - operationId: FundraisingAllowedBidders - responses: - '200': - description: A successful response. - schema: - type: object - properties: - allowed_bidders: - type: array - items: - type: object - properties: - bidder: - type: string - title: >- - bidder specifies the bech32-encoded address that bids - for the auction - max_bid_amount: - type: string - title: >- - max_bid_amount specifies the maximum bid amount that the - bidder can bid - description: AllowedBidder defines an allowed bidder for the auction. - pagination: - title: 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: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - description: >- - QueryAllowedBiddersResponse is the response type for the - Query/AllowedBidders - - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. As of May 2023, there are no widely - used type server - - implementations and no plans to implement one. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: auction_id - in: path - required: true - type: string - format: uint64 - - 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/fundraising/v1beta1/auctions/{auction_id}/allowed_bidders/{bidder}: - get: - summary: AllowedBidder returns the specific allowed bidder information. - operationId: FundraisingAllowedBidder - responses: - '200': - description: A successful response. - schema: - type: object - properties: - allowed_bidder: - type: object - properties: - bidder: - type: string - title: >- - bidder specifies the bech32-encoded address that bids for - the auction - max_bid_amount: - type: string - title: >- - max_bid_amount specifies the maximum bid amount that the - bidder can bid - description: AllowedBidder defines an allowed bidder for the auction. - description: >- - QueryAllowedBidderResponse is the response type for the - Query/AllowedBidder - - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. As of May 2023, there are no widely - used type server - - implementations and no plans to implement one. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: auction_id - in: path - required: true - type: string - format: uint64 - - name: bidder - in: path - required: true - type: string - tags: - - Query - /cosmos/fundraising/v1beta1/auctions/{auction_id}/bids: - get: - summary: Bids returns all bids. - operationId: FundraisingBids - responses: - '200': - description: A successful response. - schema: - type: object - properties: - bids: - type: array - items: - type: object - properties: - auction_id: - type: string - format: uint64 - title: auction_id specifies the id of the auction - bidder: - type: string - title: >- - bidder specifies the bech32-encoded address that bids - for the auction - id: - type: string - format: uint64 - title: id specifies an index of a bid for the bidder - type: - title: >- - type specifies the bid type; type 1 is fixed price, 2 is - how-much-worth, 3 - - is how-many-coins - type: string - enum: - - BID_TYPE_UNSPECIFIED - - BID_TYPE_FIXED_PRICE - - BID_TYPE_BATCH_WORTH - - BID_TYPE_BATCH_MANY - default: BID_TYPE_UNSPECIFIED - description: |- - BidType enumerates the valid types of a bid. - - - BID_TYPE_UNSPECIFIED: BID_TYPE_UNSPECIFIED defines the default bid type - - BID_TYPE_FIXED_PRICE: BID_TYPE_FIXED_PRICE defines a bid type for a fixed price auction type - - BID_TYPE_BATCH_WORTH: BID_TYPE_BATCH_WORTH defines a bid type for How-Much-Worth-to-Buy of a - batch auction - - BID_TYPE_BATCH_MANY: BID_TYPE_BATCH_MANY defines a bid type for How-Many-Coins-to-Buy of a batch - auction - price: - type: string - title: >- - price specifies the bid price in which price the bidder - places the bid - coin: - description: >- - coin specifies the amount of coin that the bidder bids - - for a fixed price auction, the denom is of the paying - coin. - - for a batch auction of how-much-worth, the denom is of - the paying coin. - - for a batch auction of how-many-coins, the denom is of - the selling coin. - type: object - properties: - denom: - type: string - amount: - type: string - is_matched: - type: boolean - title: >- - is_matched specifies the bid that is a winning bid and - enables the bidder - - to purchase the selling coin - description: Bid defines a standard bid for an auction. - title: bids specifies the existing bids - pagination: - title: 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: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - description: QueryBidsResponse is response type for the Query/Bids RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. As of May 2023, there are no widely - used type server - - implementations and no plans to implement one. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: auction_id - in: path - required: true - type: string - format: uint64 - - name: bidder - in: query - required: false - type: string - - name: is_matched - 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 - type: boolean - tags: - - Query - /cosmos/fundraising/v1beta1/auctions/{auction_id}/bids/{bid_id}: - get: - summary: Bid returns the specific bid from the auction id and bid id. - operationId: FundraisingBid - responses: - '200': - description: A successful response. - schema: - type: object - properties: - bid: - title: bid specifies specific bid - type: object - properties: - auction_id: - type: string - format: uint64 - title: auction_id specifies the id of the auction - bidder: - type: string - title: >- - bidder specifies the bech32-encoded address that bids for - the auction - id: - type: string - format: uint64 - title: id specifies an index of a bid for the bidder - type: - title: >- - type specifies the bid type; type 1 is fixed price, 2 is - how-much-worth, 3 - - is how-many-coins - type: string - enum: - - BID_TYPE_UNSPECIFIED - - BID_TYPE_FIXED_PRICE - - BID_TYPE_BATCH_WORTH - - BID_TYPE_BATCH_MANY - default: BID_TYPE_UNSPECIFIED - description: |- - BidType enumerates the valid types of a bid. - - - BID_TYPE_UNSPECIFIED: BID_TYPE_UNSPECIFIED defines the default bid type - - BID_TYPE_FIXED_PRICE: BID_TYPE_FIXED_PRICE defines a bid type for a fixed price auction type - - BID_TYPE_BATCH_WORTH: BID_TYPE_BATCH_WORTH defines a bid type for How-Much-Worth-to-Buy of a - batch auction - - BID_TYPE_BATCH_MANY: BID_TYPE_BATCH_MANY defines a bid type for How-Many-Coins-to-Buy of a batch - auction - price: - type: string - title: >- - price specifies the bid price in which price the bidder - places the bid - coin: - description: >- - coin specifies the amount of coin that the bidder bids - - for a fixed price auction, the denom is of the paying - coin. - - for a batch auction of how-much-worth, the denom is of the - paying coin. - - for a batch auction of how-many-coins, the denom is of the - selling coin. - type: object - properties: - denom: - type: string - amount: - type: string - is_matched: - type: boolean - title: >- - is_matched specifies the bid that is a winning bid and - enables the bidder - - to purchase the selling coin - description: Bid defines a standard bid for an auction. - description: >- - QueryBidResponse is response type for the Query/Sequence RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. As of May 2023, there are no widely - used type server - - implementations and no plans to implement one. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: auction_id - in: path - required: true - type: string - format: uint64 - - name: bid_id - in: path - required: true - type: string - format: uint64 - tags: - - Query - /cosmos/fundraising/v1beta1/auctions/{auction_id}/vestings: - get: - summary: Vestings returns all vestings for the auction. - operationId: FundraisingVestings - responses: - '200': - description: A successful response. - schema: - type: object - properties: - vestings: - type: array - items: - type: object - properties: - auction_id: - type: string - format: uint64 - title: auction_id specifies the id of the auction - auctioneer: - type: string - title: >- - auctioneer specifies the bech32-encoded address that - creates the auction - paying_coin: - title: paying_coin specifies the paying amount of coin - 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. - release_time: - type: string - format: date-time - title: >- - release_time specifies the timestamp of the vesting - schedule - released: - type: boolean - title: released specifies the status of distribution - description: VestingQueue defines the vesting queue. - title: vestings specifies the existing vestings - description: >- - QueryVestingsResponse is response type for the Query/Vestings RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. As of May 2023, there are no widely - used type server - - implementations and no plans to implement one. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: auction_id - in: path - required: true - type: string - format: uint64 - tags: - - Query - /cosmos/fundraising/v1beta1/params: - get: - summary: Params returns parameters of the fundraising module. - operationId: FundraisingParams - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - properties: - auction_creation_fee: - type: array - items: - 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. - title: >- - auction_creation_fee specifies the fee for auction - creation. - - this prevents from spamming attack and it is collected in - the community - - pool - place_bid_fee: - type: array - items: - 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. - title: >- - place_bid_fee specifies the fee for placing a bid for an - auction. - - this prevents from spamming attack and it is collected in - the community - - pool - extended_period: - type: integer - format: int64 - title: >- - extended_period specifies the extended period that - determines how long - - the extended auction round lasts - description: >- - QueryParamsResponse is response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. As of May 2023, there are no widely - used type server - - implementations and no plans to implement one. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - tags: - - Query -definitions: - google.protobuf.Any: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along with - a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the form - - of utility functions or additional generated methods of the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - google.rpc.Status: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - cosmos.auth.v1beta1.AddressBytesToStringResponse: - type: object - properties: - address_string: - type: string - description: >- - AddressBytesToStringResponse is the response type for AddressString rpc - method. - - - Since: cosmos-sdk 0.46 - cosmos.auth.v1beta1.AddressStringToBytesResponse: - type: object - properties: - address_bytes: - type: string - format: byte - description: >- - AddressStringToBytesResponse is the response type for AddressBytes rpc - method. - - - Since: cosmos-sdk 0.46 - cosmos.auth.v1beta1.BaseAccount: - type: object - properties: - address: - type: string - pub_key: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - account_number: - type: string - format: uint64 - sequence: - type: string - format: uint64 - description: >- - BaseAccount defines a base account type. It contains all the necessary - fields - - for basic account functionality. Any custom account type should extend - this - - type for additional functionality (e.g. vesting). - cosmos.auth.v1beta1.Bech32PrefixResponse: - type: object - properties: - bech32_prefix: - type: string - description: |- - Bech32PrefixResponse is the response type for Bech32Prefix rpc method. - - Since: cosmos-sdk 0.46 - cosmos.auth.v1beta1.Params: - type: object - properties: - max_memo_characters: - type: string - format: uint64 - tx_sig_limit: - type: string - format: uint64 - tx_size_cost_per_byte: - type: string - format: uint64 - sig_verify_cost_ed25519: - type: string - format: uint64 - sig_verify_cost_secp256k1: - type: string - format: uint64 - description: Params defines the parameters for the auth module. - cosmos.auth.v1beta1.QueryAccountAddressByIDResponse: - type: object - properties: - account_address: - type: string - description: 'Since: cosmos-sdk 0.46.2' - title: >- - QueryAccountAddressByIDResponse is the response type for - AccountAddressByID rpc method - cosmos.auth.v1beta1.QueryAccountInfoResponse: - type: object - properties: - info: - description: info is the account info which is represented by BaseAccount. - type: object - properties: - address: - type: string - pub_key: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - account_number: - type: string - format: uint64 - sequence: - type: string - format: uint64 - description: |- - QueryAccountInfoResponse is the Query/AccountInfo response type. - - Since: cosmos-sdk 0.47 - cosmos.auth.v1beta1.QueryAccountResponse: - type: object - properties: - account: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - QueryAccountResponse is the response type for the Query/Account RPC - method. - cosmos.auth.v1beta1.QueryAccountsResponse: - type: object - properties: - accounts: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: accounts are the existing accounts - 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: >- - QueryAccountsResponse is the response type for the Query/Accounts RPC - method. - - - Since: cosmos-sdk 0.43 - cosmos.auth.v1beta1.QueryModuleAccountByNameResponse: - type: object - properties: - account: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - QueryModuleAccountByNameResponse is the response type for the - Query/ModuleAccountByName RPC method. - cosmos.auth.v1beta1.QueryModuleAccountsResponse: - type: object - properties: - accounts: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - QueryModuleAccountsResponse is the response type for the - Query/ModuleAccounts RPC method. - - - Since: cosmos-sdk 0.46 - cosmos.auth.v1beta1.QueryParamsResponse: - type: object - properties: - params: - description: params defines the parameters of the module. - type: object - properties: - max_memo_characters: - type: string - format: uint64 - tx_sig_limit: - type: string - format: uint64 - tx_size_cost_per_byte: - type: string - format: uint64 - sig_verify_cost_ed25519: - type: string - format: uint64 - sig_verify_cost_secp256k1: - type: string - format: uint64 - description: QueryParamsResponse is the response type for the Query/Params RPC method. - cosmos.base.query.v1beta1.PageRequest: - type: object - properties: - key: - type: string - format: byte - 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. - offset: - type: string - format: uint64 - 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. - limit: - type: string - format: uint64 - 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. - count_total: - type: boolean - 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. - reverse: - type: boolean - description: >- - reverse is set to true if results are to be returned in the descending - order. - - - Since: cosmos-sdk 0.43 - description: |- - message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } - title: |- - PageRequest is to be embedded in gRPC request messages for efficient - pagination. Ex: - cosmos.base.query.v1beta1.PageResponse: - 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: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - cosmos.auth.v1beta1.MsgUpdateParamsResponse: - type: object - description: |- - MsgUpdateParamsResponse defines the response structure for executing a - MsgUpdateParams message. - - Since: cosmos-sdk 0.47 - cosmos.authz.v1beta1.Grant: - type: object - properties: - authorization: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - expiration: - type: string - format: date-time - title: >- - time when the grant will expire and will be pruned. If null, then the - grant - - doesn't have a time expiration (other conditions in `authorization` - - may apply to invalidate the grant) - description: |- - Grant gives permissions to execute - the provide method with expiration time. - cosmos.authz.v1beta1.GrantAuthorization: - type: object - properties: - granter: - type: string - grantee: - type: string - authorization: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - expiration: - type: string - format: date-time - title: >- - GrantAuthorization extends a grant with both the addresses of the grantee - and granter. - - It is used in genesis.proto and query.proto - cosmos.authz.v1beta1.QueryGranteeGrantsResponse: - type: object - properties: - grants: - type: array - items: - type: object - properties: - granter: - type: string - grantee: - type: string - authorization: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - expiration: - type: string - format: date-time - title: >- - GrantAuthorization extends a grant with both the addresses of the - grantee and granter. - - It is used in genesis.proto and query.proto - description: grants is a list of grants granted to the grantee. - pagination: - description: pagination defines an pagination for 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: >- - QueryGranteeGrantsResponse is the response type for the - Query/GranteeGrants RPC method. - cosmos.authz.v1beta1.QueryGranterGrantsResponse: - type: object - properties: - grants: - type: array - items: - type: object - properties: - granter: - type: string - grantee: - type: string - authorization: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - expiration: - type: string - format: date-time - title: >- - GrantAuthorization extends a grant with both the addresses of the - grantee and granter. - - It is used in genesis.proto and query.proto - description: grants is a list of grants granted by the granter. - pagination: - description: pagination defines an pagination for 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: >- - QueryGranterGrantsResponse is the response type for the - Query/GranterGrants RPC method. - cosmos.authz.v1beta1.QueryGrantsResponse: - type: object - properties: - grants: - type: array - items: - type: object - properties: - authorization: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - expiration: - type: string - format: date-time - title: >- - time when the grant will expire and will be pruned. If null, - then the grant - - doesn't have a time expiration (other conditions in - `authorization` - - may apply to invalidate the grant) - description: |- - Grant gives permissions to execute - the provide method with expiration time. - description: authorizations is a list of grants granted for grantee by granter. - pagination: - description: pagination defines an pagination for 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: >- - QueryGrantsResponse is the response type for the Query/Authorizations RPC - method. - cosmos.authz.v1beta1.MsgExecResponse: - type: object - properties: - results: - type: array - items: - type: string - format: byte - description: MsgExecResponse defines the Msg/MsgExecResponse response type. - cosmos.authz.v1beta1.MsgGrantResponse: - type: object - description: MsgGrantResponse defines the Msg/MsgGrant response type. - cosmos.authz.v1beta1.MsgRevokeResponse: - type: object - description: MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. - cosmos.bank.v1beta1.DenomOwner: - type: object - properties: - address: - type: string - description: address defines the address that owns a particular denomination. - balance: - description: balance is the balance of the denominated coin for an account. - type: object - properties: - denom: - type: string - amount: - type: string - 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 - cosmos.bank.v1beta1.DenomUnit: - 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. - cosmos.bank.v1beta1.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. - cosmos.bank.v1beta1.Params: - type: object - properties: - send_enabled: - type: array - items: - type: object - properties: - denom: - type: string - enabled: - type: boolean - description: >- - SendEnabled maps coin denom to a send_enabled status (whether a - denom is - - sendable). - description: >- - Deprecated: Use of SendEnabled in params is deprecated. - - For genesis, use the newly added send_enabled field in the genesis - object. - - Storage, lookup, and manipulation of this information is now in the - keeper. - - - As of cosmos-sdk 0.47, this only exists for backwards compatibility of - genesis files. - default_send_enabled: - type: boolean - description: Params defines the parameters for the bank module. - cosmos.bank.v1beta1.QueryAllBalancesResponse: - type: object - properties: - balances: - type: array - items: - 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: balances is the balances of all the coins. - 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: >- - QueryAllBalancesResponse is the response type for the Query/AllBalances - RPC - - method. - cosmos.bank.v1beta1.QueryBalanceResponse: - type: object - properties: - balance: - description: balance is the balance of the coin. - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - QueryBalanceResponse is the response type for the Query/Balance RPC - method. - cosmos.bank.v1beta1.QueryDenomMetadataResponse: - type: object - properties: - metadata: - description: >- - metadata describes and provides all the client information for the - requested token. - 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: >- - QueryDenomMetadataResponse is the response type for the - Query/DenomMetadata RPC - - method. - cosmos.bank.v1beta1.QueryDenomOwnersResponse: - 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: - description: balance is the balance of the denominated coin for an account. - type: object - properties: - denom: - type: string - amount: - type: string - 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: >- - QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC - query. - - - Since: cosmos-sdk 0.46 - cosmos.bank.v1beta1.QueryDenomsMetadataResponse: - type: object - properties: - metadatas: - type: array - items: - 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: >- - metadata provides the client information for all the registered - tokens. - 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: >- - QueryDenomsMetadataResponse is the response type for the - Query/DenomsMetadata RPC - - method. - cosmos.bank.v1beta1.QueryParamsResponse: - type: object - properties: - params: - type: object - properties: - send_enabled: - type: array - items: - type: object - properties: - denom: - type: string - enabled: - type: boolean - description: >- - SendEnabled maps coin denom to a send_enabled status (whether a - denom is - - sendable). - description: >- - Deprecated: Use of SendEnabled in params is deprecated. - - For genesis, use the newly added send_enabled field in the genesis - object. - - Storage, lookup, and manipulation of this information is now in - the keeper. - - - As of cosmos-sdk 0.47, this only exists for backwards - 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. - cosmos.bank.v1beta1.QuerySendEnabledResponse: - type: object - properties: - send_enabled: - type: array - items: - type: object - properties: - denom: - type: string - enabled: - type: boolean - description: >- - SendEnabled maps coin denom to a send_enabled status (whether a - denom is - - sendable). - pagination: - description: |- - pagination defines the pagination in the response. This field is only - populated if the denoms field in the request is empty. - 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: |- - QuerySendEnabledResponse defines the RPC response of a SendEnable query. - - Since: cosmos-sdk 0.47 - cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse: - type: object - properties: - balance: - description: balance is the balance of the coin. - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - QuerySpendableBalanceByDenomResponse defines the gRPC response structure - for - - querying an account's spendable balance for a specific denom. - - - Since: cosmos-sdk 0.47 - cosmos.bank.v1beta1.QuerySpendableBalancesResponse: - type: object - properties: - balances: - type: array - items: - 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: balances is the spendable balances of all the coins. - 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: >- - QuerySpendableBalancesResponse defines the gRPC response structure for - querying - - an account's spendable balances. - - - Since: cosmos-sdk 0.46 - cosmos.bank.v1beta1.QuerySupplyOfResponse: - type: object - properties: - amount: - description: amount is the supply of the coin. - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC - method. - cosmos.bank.v1beta1.QueryTotalSupplyResponse: - type: object - properties: - supply: - type: array - items: - 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. - title: supply is the supply of the coins - pagination: - description: |- - pagination defines the pagination in the response. - - Since: cosmos-sdk 0.43 - 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 - title: >- - QueryTotalSupplyResponse is the response type for the Query/TotalSupply - RPC - - method - cosmos.bank.v1beta1.SendEnabled: - type: object - properties: - denom: - type: string - enabled: - type: boolean - description: |- - SendEnabled maps coin denom to a send_enabled status (whether a denom is - sendable). - cosmos.base.v1beta1.Coin: - 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. - cosmos.bank.v1beta1.Input: - type: object - properties: - address: - type: string - coins: - type: array - items: - 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: Input models transaction input. - cosmos.bank.v1beta1.MsgMultiSendResponse: - type: object - description: MsgMultiSendResponse defines the Msg/MultiSend response type. - cosmos.bank.v1beta1.MsgSendResponse: - type: object - description: MsgSendResponse defines the Msg/Send response type. - cosmos.bank.v1beta1.MsgSetSendEnabledResponse: - type: object - description: |- - MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. - - Since: cosmos-sdk 0.47 - cosmos.bank.v1beta1.MsgUpdateParamsResponse: - type: object - description: |- - MsgUpdateParamsResponse defines the response structure for executing a - MsgUpdateParams message. - - Since: cosmos-sdk 0.47 - cosmos.bank.v1beta1.Output: - type: object - properties: - address: - type: string - coins: - type: array - items: - 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: Output models transaction outputs. - cosmos.base.node.v1beta1.ConfigResponse: - type: object - properties: - minimum_gas_price: - type: string - description: ConfigResponse defines the response structure for the Config gRPC query. - cosmos.base.tendermint.v1beta1.ABCIQueryResponse: - type: object - properties: - code: - type: integer - format: int64 - log: - type: string - title: nondeterministic - info: - type: string - title: nondeterministic - index: - type: string - format: int64 - key: - type: string - format: byte - value: - type: string - format: byte - proof_ops: - type: object - properties: - ops: - type: array - items: - type: object - properties: - type: - type: string - key: - type: string - format: byte - data: - type: string - format: byte - description: >- - ProofOp defines an operation used for calculating Merkle root. - The data could - - be arbitrary format, providing necessary data for example - neighbouring node - - hash. - - - Note: This type is a duplicate of the ProofOp proto type defined - in Tendermint. - description: >- - ProofOps is Merkle proof defined by the list of ProofOps. - - - Note: This type is a duplicate of the ProofOps proto type defined in - Tendermint. - height: - type: string - format: int64 - codespace: - type: string - description: >- - ABCIQueryResponse defines the response structure for the ABCIQuery gRPC - query. - - - Note: This type is a duplicate of the ResponseQuery proto type defined in - - Tendermint. - cosmos.base.tendermint.v1beta1.Block: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block in - the blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - description: >- - proposer_address is the original block proposer address, formatted - as a Bech32 string. - - In Tendermint, this type is `bytes`, but in the SDK, we convert it - to a Bech32 string - - for better UX. - - - original proposer of the block - description: Header defines the structure of a Tendermint block header. - data: - type: object - properties: - txs: - type: array - items: - type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. - - NOTE: not all txs here are valid. We're just agreeing on the - order first. - - This means that block.AppHash does not include these txs. - title: Data contains the set of transactions included in the block - evidence: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for - - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a validator - signed two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for - processing a block in the blockchain, - - including all blockchain data structures and - the rules of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs from - the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a block was - committed by a set of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use - with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use with - Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of - validators attempting to mislead a light client. - last_commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a set of - validators. - description: |- - Block is tendermint type Block, with the Header proposer address - field converted to bech32 string. - cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse: - type: object - properties: - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - block: - title: 'Deprecated: please use `sdk_block` instead' - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block - in the blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - data: - type: object - properties: - txs: - type: array - items: - type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. - - NOTE: not all txs here are valid. We're just agreeing on the - order first. - - This means that block.AppHash does not include these txs. - title: Data contains the set of transactions included in the block - evidence: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for - - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a validator - signed two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules - for processing a block in the - blockchain, - - including all blockchain data structures - and the rules of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: >- - commit from validators from the last - block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs - from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: >- - Header defines the structure of a block - header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a block - was committed by a set of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use - with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of - validators attempting to mislead a light client. - last_commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a set - of validators. - sdk_block: - title: 'Since: cosmos-sdk 0.47' - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block - in the blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - description: >- - proposer_address is the original block proposer address, - formatted as a Bech32 string. - - In Tendermint, this type is `bytes`, but in the SDK, we - convert it to a Bech32 string - - for better UX. - - - original proposer of the block - description: Header defines the structure of a Tendermint block header. - data: - type: object - properties: - txs: - type: array - items: - type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. - - NOTE: not all txs here are valid. We're just agreeing on the - order first. - - This means that block.AppHash does not include these txs. - title: Data contains the set of transactions included in the block - evidence: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for - - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a validator - signed two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules - for processing a block in the - blockchain, - - including all blockchain data structures - and the rules of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: >- - commit from validators from the last - block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs - from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: >- - Header defines the structure of a block - header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a block - was committed by a set of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use - with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of - validators attempting to mislead a light client. - last_commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a set - of validators. - description: |- - Block is tendermint type Block, with the Header proposer address - field converted to bech32 string. - description: >- - GetBlockByHeightResponse is the response type for the - Query/GetBlockByHeight RPC method. - cosmos.base.tendermint.v1beta1.GetLatestBlockResponse: - type: object - properties: - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - block: - title: 'Deprecated: please use `sdk_block` instead' - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block - in the blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - data: - type: object - properties: - txs: - type: array - items: - type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. - - NOTE: not all txs here are valid. We're just agreeing on the - order first. - - This means that block.AppHash does not include these txs. - title: Data contains the set of transactions included in the block - evidence: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for - - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a validator - signed two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules - for processing a block in the - blockchain, - - including all blockchain data structures - and the rules of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: >- - commit from validators from the last - block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs - from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: >- - Header defines the structure of a block - header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a block - was committed by a set of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use - with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of - validators attempting to mislead a light client. - last_commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a set - of validators. - sdk_block: - title: 'Since: cosmos-sdk 0.47' - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block - in the blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - description: >- - proposer_address is the original block proposer address, - formatted as a Bech32 string. - - In Tendermint, this type is `bytes`, but in the SDK, we - convert it to a Bech32 string - - for better UX. - - - original proposer of the block - description: Header defines the structure of a Tendermint block header. - data: - type: object - properties: - txs: - type: array - items: - type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. - - NOTE: not all txs here are valid. We're just agreeing on the - order first. - - This means that block.AppHash does not include these txs. - title: Data contains the set of transactions included in the block - evidence: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for - - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a validator - signed two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules - for processing a block in the - blockchain, - - including all blockchain data structures - and the rules of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: >- - commit from validators from the last - block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs - from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: >- - Header defines the structure of a block - header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a block - was committed by a set of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use - with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of - validators attempting to mislead a light client. - last_commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a set - of validators. - description: |- - Block is tendermint type Block, with the Header proposer address - field converted to bech32 string. - description: >- - GetLatestBlockResponse is the response type for the Query/GetLatestBlock - RPC method. - cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse: - type: object - properties: - block_height: - type: string - format: int64 - validators: - type: array - items: - type: object - properties: - address: - type: string - pub_key: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - description: Validator is the type for the validator-set. - pagination: - description: pagination defines an pagination for 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: >- - GetLatestValidatorSetResponse is the response type for the - Query/GetValidatorSetByHeight RPC method. - cosmos.base.tendermint.v1beta1.GetNodeInfoResponse: - type: object - properties: - default_node_info: - type: object - properties: - protocol_version: - type: object - properties: - p2p: - type: string - format: uint64 - block: - type: string - format: uint64 - app: - type: string - format: uint64 - default_node_id: - type: string - listen_addr: - type: string - network: - type: string - version: - type: string - channels: - type: string - format: byte - moniker: - type: string - other: - type: object - properties: - tx_index: - type: string - rpc_address: - type: string - application_version: - type: object - properties: - name: - type: string - app_name: - type: string - version: - type: string - git_commit: - type: string - build_tags: - type: string - go_version: - type: string - build_deps: - type: array - items: - type: object - properties: - path: - type: string - title: module path - version: - type: string - title: module version - sum: - type: string - title: checksum - title: Module is the type for VersionInfo - cosmos_sdk_version: - type: string - title: 'Since: cosmos-sdk 0.43' - description: VersionInfo is the type for the GetNodeInfoResponse message. - description: >- - GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC - method. - cosmos.base.tendermint.v1beta1.GetSyncingResponse: - type: object - properties: - syncing: - type: boolean - description: >- - GetSyncingResponse is the response type for the Query/GetSyncing RPC - method. - cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse: - type: object - properties: - block_height: - type: string - format: int64 - validators: - type: array - items: - type: object - properties: - address: - type: string - pub_key: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - description: Validator is the type for the validator-set. - pagination: - description: pagination defines an pagination for 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: >- - GetValidatorSetByHeightResponse is the response type for the - Query/GetValidatorSetByHeight RPC method. - cosmos.base.tendermint.v1beta1.Header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block in the - blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - description: >- - proposer_address is the original block proposer address, formatted as - a Bech32 string. - - In Tendermint, this type is `bytes`, but in the SDK, we convert it to - a Bech32 string - - for better UX. - - - original proposer of the block - description: Header defines the structure of a Tendermint block header. - cosmos.base.tendermint.v1beta1.Module: - type: object - properties: - path: - type: string - title: module path - version: - type: string - title: module version - sum: - type: string - title: checksum - title: Module is the type for VersionInfo - cosmos.base.tendermint.v1beta1.ProofOp: - type: object - properties: - type: - type: string - key: - type: string - format: byte - data: - type: string - format: byte - description: >- - ProofOp defines an operation used for calculating Merkle root. The data - could - - be arbitrary format, providing necessary data for example neighbouring - node - - hash. - - - Note: This type is a duplicate of the ProofOp proto type defined in - Tendermint. - cosmos.base.tendermint.v1beta1.ProofOps: - type: object - properties: - ops: - type: array - items: - type: object - properties: - type: - type: string - key: - type: string - format: byte - data: - type: string - format: byte - description: >- - ProofOp defines an operation used for calculating Merkle root. The - data could - - be arbitrary format, providing necessary data for example - neighbouring node - - hash. - - - Note: This type is a duplicate of the ProofOp proto type defined in - Tendermint. - description: >- - ProofOps is Merkle proof defined by the list of ProofOps. - - - Note: This type is a duplicate of the ProofOps proto type defined in - Tendermint. - cosmos.base.tendermint.v1beta1.Validator: - type: object - properties: - address: - type: string - pub_key: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - description: Validator is the type for the validator-set. - cosmos.base.tendermint.v1beta1.VersionInfo: - type: object - properties: - name: - type: string - app_name: - type: string - version: - type: string - git_commit: - type: string - build_tags: - type: string - go_version: - type: string - build_deps: - type: array - items: - type: object - properties: - path: - type: string - title: module path - version: - type: string - title: module version - sum: - type: string - title: checksum - title: Module is the type for VersionInfo - cosmos_sdk_version: - type: string - title: 'Since: cosmos-sdk 0.43' - description: VersionInfo is the type for the GetNodeInfoResponse message. - tendermint.crypto.PublicKey: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: PublicKey defines the keys available for use with Validators - tendermint.p2p.DefaultNodeInfo: - type: object - properties: - protocol_version: - type: object - properties: - p2p: - type: string - format: uint64 - block: - type: string - format: uint64 - app: - type: string - format: uint64 - default_node_id: - type: string - listen_addr: - type: string - network: - type: string - version: - type: string - channels: - type: string - format: byte - moniker: - type: string - other: - type: object - properties: - tx_index: - type: string - rpc_address: - type: string - tendermint.p2p.DefaultNodeInfoOther: - type: object - properties: - tx_index: - type: string - rpc_address: - type: string - tendermint.p2p.ProtocolVersion: - type: object - properties: - p2p: - type: string - format: uint64 - block: - type: string - format: uint64 - app: - type: string - format: uint64 - tendermint.types.Block: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block in - the blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - data: - type: object - properties: - txs: - type: array - items: - type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. - - NOTE: not all txs here are valid. We're just agreeing on the - order first. - - This means that block.AppHash does not include these txs. - title: Data contains the set of transactions included in the block - evidence: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for - - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a validator - signed two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for - processing a block in the blockchain, - - including all blockchain data structures and - the rules of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs from - the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a block was - committed by a set of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use - with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use with - Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of - validators attempting to mislead a light client. - last_commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a set of - validators. - tendermint.types.BlockID: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - tendermint.types.BlockIDFlag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - tendermint.types.Commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a set of - validators. - tendermint.types.CommitSig: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - tendermint.types.Data: - type: object - properties: - txs: - type: array - items: - type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. - - NOTE: not all txs here are valid. We're just agreeing on the order - first. - - This means that block.AppHash does not include these txs. - title: Data contains the set of transactions included in the block - tendermint.types.DuplicateVoteEvidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: |- - SignedMsgType is a type of signed message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote from validators - for - - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: |- - SignedMsgType is a type of signed message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote from validators - for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a validator signed two - conflicting votes. - tendermint.types.Evidence: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: |- - SignedMsgType is a type of signed message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote from - validators for - - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: |- - SignedMsgType is a type of signed message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote from - validators for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a validator signed two - conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing - a block in the blockchain, - - including all blockchain data structures and the rules - of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs from the - previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included in a - Commit. - description: >- - Commit contains the evidence that a block was committed by - a set of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use with - Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use with - Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: PublicKey defines the keys available for use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of validators - attempting to mislead a light client. - tendermint.types.EvidenceList: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote from - validators for - - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote from - validators for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a validator signed - two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for - processing a block in the blockchain, - - including all blockchain data structures and the - rules of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs from the - previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included in a - Commit. - description: >- - Commit contains the evidence that a block was - committed by a set of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use - with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use - with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use with - Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of - validators attempting to mislead a light client. - tendermint.types.Header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block in the - blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - tendermint.types.LightBlock: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block - in the blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a set - of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: PublicKey defines the keys available for use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: PublicKey defines the keys available for use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - tendermint.types.LightClientAttackEvidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a - block in the blockchain, - - including all blockchain data structures and the rules of - the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs from the previous - block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the signature is - for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a - set of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use with - Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use with - Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: PublicKey defines the keys available for use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of validators - attempting to mislead a light client. - tendermint.types.PartSetHeader: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - tendermint.types.SignedHeader: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block in - the blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a set of - validators. - tendermint.types.SignedMsgType: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: |- - SignedMsgType is a type of signed message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - tendermint.types.Validator: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: PublicKey defines the keys available for use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - tendermint.types.ValidatorSet: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: PublicKey defines the keys available for use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: PublicKey defines the keys available for use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - tendermint.types.Vote: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: |- - SignedMsgType is a type of signed message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: |- - Vote represents a prevote, precommit, or commit vote from validators for - consensus. - tendermint.version.Consensus: - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block in the - blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - 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. - description: >- - QueryParamsResponse defines the response type for querying x/consensus - parameters. - 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. - 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.consensus.v1.MsgUpdateParamsResponse: - type: object - description: |- - MsgUpdateParamsResponse defines the response structure for executing a - MsgUpdateParams message. - cosmos.crisis.v1beta1.MsgUpdateParamsResponse: - type: object - description: |- - MsgUpdateParamsResponse defines the response structure for executing a - MsgUpdateParams message. - - Since: cosmos-sdk 0.47 - cosmos.crisis.v1beta1.MsgVerifyInvariantResponse: - type: object - description: MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. - cosmos.base.v1beta1.DecCoin: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - cosmos.distribution.v1beta1.DelegationDelegatorReward: - type: object - properties: - validator_address: - type: string - reward: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: |- - DelegationDelegatorReward represents the properties - of a delegator's delegation reward. - cosmos.distribution.v1beta1.Params: - type: object - properties: - community_tax: - type: string - base_proposer_reward: - type: string - description: >- - Deprecated: The base_proposer_reward field is deprecated and is no - longer used - - in the x/distribution module's reward mechanism. - bonus_proposer_reward: - type: string - description: >- - Deprecated: The bonus_proposer_reward field is deprecated and is no - longer used - - in the x/distribution module's reward mechanism. - withdraw_addr_enabled: - type: boolean - description: Params defines the set of params for the distribution module. - cosmos.distribution.v1beta1.QueryCommunityPoolResponse: - type: object - properties: - pool: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: pool defines community pool's coins. - description: >- - QueryCommunityPoolResponse is the response type for the - Query/CommunityPool - - RPC method. - cosmos.distribution.v1beta1.QueryDelegationRewardsResponse: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: rewards defines the rewards accrued by a delegation. - description: |- - QueryDelegationRewardsResponse is the response type for the - Query/DelegationRewards RPC method. - cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - validator_address: - type: string - reward: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - description: |- - DelegationDelegatorReward represents the properties - of a delegator's delegation reward. - description: rewards defines all the rewards accrued by a delegator. - total: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: total defines the sum of all the rewards. - description: |- - QueryDelegationTotalRewardsResponse is the response type for the - Query/DelegationTotalRewards RPC method. - cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse: - type: object - properties: - validators: - type: array - items: - type: string - description: validators defines the validators a delegator is delegating for. - description: |- - QueryDelegatorValidatorsResponse is the response type for the - Query/DelegatorValidators RPC method. - cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse: - type: object - properties: - withdraw_address: - type: string - description: withdraw_address defines the delegator address to query for. - description: |- - QueryDelegatorWithdrawAddressResponse is the response type for the - Query/DelegatorWithdrawAddress RPC method. - cosmos.distribution.v1beta1.QueryParamsResponse: - type: object - properties: - params: - description: params defines the parameters of the module. - type: object - properties: - community_tax: - type: string - base_proposer_reward: - type: string - description: >- - Deprecated: The base_proposer_reward field is deprecated and is no - longer used - - in the x/distribution module's reward mechanism. - bonus_proposer_reward: - type: string - description: >- - Deprecated: The bonus_proposer_reward field is deprecated and is - no longer used - - in the x/distribution module's reward mechanism. - withdraw_addr_enabled: - type: boolean - description: QueryParamsResponse is the response type for the Query/Params RPC method. - cosmos.distribution.v1beta1.QueryValidatorCommissionResponse: - type: object - properties: - commission: - description: commission defines the commission the validator received. - type: object - properties: - commission: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - title: |- - QueryValidatorCommissionResponse is the response type for the - Query/ValidatorCommission RPC method - cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse: - type: object - properties: - operator_address: - type: string - description: operator_address defines the validator operator address. - self_bond_rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: self_bond_rewards defines the self delegations rewards. - commission: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: commission defines the commission the validator received. - description: >- - QueryValidatorDistributionInfoResponse is the response type for the - Query/ValidatorDistributionInfo RPC method. - cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse: - type: object - properties: - rewards: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - description: >- - ValidatorOutstandingRewards represents outstanding (un-withdrawn) - rewards - - for a validator inexpensive to track, allows simple sanity checks. - description: |- - QueryValidatorOutstandingRewardsResponse is the response type for the - Query/ValidatorOutstandingRewards RPC method. - cosmos.distribution.v1beta1.QueryValidatorSlashesResponse: - type: object - properties: - slashes: - type: array - items: - type: object - properties: - validator_period: - type: string - format: uint64 - fraction: - type: string - description: |- - ValidatorSlashEvent represents a validator slash event. - Height is implicit within the store key. - This is needed to calculate appropriate amount of staking tokens - for delegations which are withdrawn after a slash has occurred. - description: slashes defines the slashes the validator received. - 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: |- - QueryValidatorSlashesResponse is the response type for the - Query/ValidatorSlashes RPC method. - cosmos.distribution.v1beta1.ValidatorAccumulatedCommission: - type: object - properties: - commission: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: |- - ValidatorAccumulatedCommission represents accumulated commission - for a validator kept as a running counter, can be withdrawn at any time. - cosmos.distribution.v1beta1.ValidatorOutstandingRewards: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: |- - ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards - for a validator inexpensive to track, allows simple sanity checks. - cosmos.distribution.v1beta1.ValidatorSlashEvent: - type: object - properties: - validator_period: - type: string - format: uint64 - fraction: - type: string - description: |- - ValidatorSlashEvent represents a validator slash event. - Height is implicit within the store key. - This is needed to calculate appropriate amount of staking tokens - for delegations which are withdrawn after a slash has occurred. - cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse: - type: object - description: |- - MsgCommunityPoolSpendResponse defines the response to executing a - MsgCommunityPoolSpend message. - - Since: cosmos-sdk 0.47 - cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse: - type: object - description: >- - MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response - type. - cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse: - type: object - description: |- - MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response - type. - cosmos.distribution.v1beta1.MsgUpdateParamsResponse: - type: object - description: |- - MsgUpdateParamsResponse defines the response structure for executing a - MsgUpdateParams message. - - Since: cosmos-sdk 0.47 - cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse: - type: object - properties: - amount: - type: array - items: - 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. - title: 'Since: cosmos-sdk 0.46' - description: |- - MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward - response type. - cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse: - type: object - properties: - amount: - type: array - items: - 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. - title: 'Since: cosmos-sdk 0.46' - description: |- - MsgWithdrawValidatorCommissionResponse defines the - Msg/WithdrawValidatorCommission response type. - cosmos.evidence.v1beta1.QueryAllEvidenceResponse: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: evidence returns all evidences. - 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: >- - QueryAllEvidenceResponse is the response type for the Query/AllEvidence - RPC - - method. - cosmos.evidence.v1beta1.QueryEvidenceResponse: - type: object - properties: - evidence: - description: evidence returns the requested evidence. - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - QueryEvidenceResponse is the response type for the Query/Evidence RPC - method. - cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse: - type: object - properties: - hash: - type: string - format: byte - description: hash defines the hash of the evidence. - description: MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. - cosmos.feegrant.v1beta1.Grant: - type: object - properties: - granter: - type: string - description: >- - granter is the address of the user granting an allowance of their - funds. - grantee: - type: string - description: >- - grantee is the address of the user being granted an allowance of - another user's funds. - allowance: - description: allowance can be any of basic, periodic, allowed fee allowance. - type: object - properties: - '@type': - 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. - additionalProperties: {} - title: Grant is stored in the KVStore to record a grant with full context - cosmos.feegrant.v1beta1.QueryAllowanceResponse: - type: object - properties: - allowance: - description: allowance is a allowance granted for grantee by granter. - type: object - properties: - granter: - type: string - description: >- - granter is the address of the user granting an allowance of their - funds. - grantee: - type: string - description: >- - grantee is the address of the user being granted an allowance of - another user's funds. - allowance: - description: allowance can be any of basic, periodic, allowed fee allowance. - type: object - properties: - '@type': - 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. - additionalProperties: {} - title: Grant is stored in the KVStore to record a grant with full context - description: >- - QueryAllowanceResponse is the response type for the Query/Allowance RPC - method. - cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse: - type: object - properties: - allowances: - type: array - items: - type: object - properties: - granter: - type: string - description: >- - granter is the address of the user granting an allowance of - their funds. - grantee: - type: string - description: >- - grantee is the address of the user being granted an allowance of - another user's funds. - allowance: - description: allowance can be any of basic, periodic, allowed fee allowance. - type: object - properties: - '@type': - 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. - additionalProperties: {} - title: Grant is stored in the KVStore to record a grant with full context - description: allowances that have been issued by the granter. - pagination: - description: pagination defines an pagination for 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: >- - QueryAllowancesByGranterResponse is the response type for the - Query/AllowancesByGranter RPC method. - - - Since: cosmos-sdk 0.46 - cosmos.feegrant.v1beta1.QueryAllowancesResponse: - type: object - properties: - allowances: - type: array - items: - type: object - properties: - granter: - type: string - description: >- - granter is the address of the user granting an allowance of - their funds. - grantee: - type: string - description: >- - grantee is the address of the user being granted an allowance of - another user's funds. - allowance: - description: allowance can be any of basic, periodic, allowed fee allowance. - type: object - properties: - '@type': - 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. - additionalProperties: {} - title: Grant is stored in the KVStore to record a grant with full context - description: allowances are allowance's granted for grantee by granter. - pagination: - description: pagination defines an pagination for 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: >- - QueryAllowancesResponse is the response type for the Query/Allowances RPC - method. - cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse: - type: object - description: >- - MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response - type. - cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse: - type: object - description: >- - MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse - response type. - cosmos.gov.v1.MsgDepositResponse: - type: object - description: MsgDepositResponse defines the Msg/Deposit response type. - cosmos.gov.v1.MsgExecLegacyContentResponse: - type: object - description: >- - MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response - type. - cosmos.gov.v1.MsgSubmitProposalResponse: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - description: MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. - cosmos.gov.v1.MsgUpdateParamsResponse: - type: object - description: |- - MsgUpdateParamsResponse defines the response structure for executing a - MsgUpdateParams message. - - Since: cosmos-sdk 0.47 - cosmos.gov.v1.MsgVoteResponse: - type: object - description: MsgVoteResponse defines the Msg/Vote response type. - cosmos.gov.v1.MsgVoteWeightedResponse: - type: object - description: MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. - cosmos.gov.v1.Params: - type: object - properties: - min_deposit: - type: array - items: - 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: Minimum deposit for a proposal to enter voting period. - max_deposit_period: - type: string - description: >- - Maximum period for Atom holders to deposit on a proposal. Initial - value: 2 - - months. - voting_period: - type: string - description: Duration of the voting period. - quorum: - type: string - description: |- - Minimum percentage of total stake needed to vote for a result to be - considered valid. - threshold: - type: string - description: >- - Minimum proportion of Yes votes for proposal to pass. Default value: - 0.5. - veto_threshold: - type: string - description: |- - Minimum value of Veto votes to Total votes ratio for proposal to be - vetoed. Default value: 1/3. - min_initial_deposit_ratio: - type: string - description: >- - The ratio representing the proportion of the deposit value that must - be paid at proposal submission. - burn_vote_quorum: - type: boolean - title: burn deposits if a proposal does not meet quorum - burn_proposal_deposit_prevote: - type: boolean - title: burn deposits if the proposal does not enter voting period - burn_vote_veto: - type: boolean - title: burn deposits if quorum with vote type no_veto is met - description: |- - Params defines the parameters for the x/gov module. - - Since: cosmos-sdk 0.47 - cosmos.gov.v1.VoteOption: - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given governance - proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - 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.gov.v1.WeightedVoteOption: - type: object - properties: - option: - description: >- - option defines the valid vote options, it must not contain duplicate - vote options. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - weight: - type: string - description: weight is the vote weight associated with the vote option. - description: WeightedVoteOption defines a unit of vote for vote split. - cosmos.gov.v1.Deposit: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - depositor: - type: string - description: depositor defines the deposit addresses from the proposals. - amount: - type: array - items: - 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: amount to be deposited by depositor. - description: |- - Deposit defines an amount deposited by an account address to an active - proposal. - cosmos.gov.v1.DepositParams: - type: object - properties: - min_deposit: - type: array - items: - 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: Minimum deposit for a proposal to enter voting period. - max_deposit_period: - type: string - description: >- - Maximum period for Atom holders to deposit on a proposal. Initial - value: 2 - - months. - description: DepositParams defines the params for deposits on governance proposals. - cosmos.gov.v1.Proposal: - type: object - properties: - id: - type: string - format: uint64 - description: id defines the unique id of the proposal. - messages: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - messages are the arbitrary messages to be executed if the proposal - passes. - status: - description: status defines the proposal status. - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - final_tally_result: - description: |- - final_tally_result is the final tally result of the proposal. When - querying a proposal via gRPC, this field is not populated until the - proposal's voting period has ended. - type: object - properties: - yes_count: - type: string - description: yes_count is the number of yes votes on a proposal. - abstain_count: - type: string - description: abstain_count is the number of abstain votes on a proposal. - no_count: - type: string - description: no_count is the number of no votes on a proposal. - no_with_veto_count: - type: string - description: >- - no_with_veto_count is the number of no with veto votes on a - proposal. - submit_time: - type: string - format: date-time - description: submit_time is the time of proposal submission. - deposit_end_time: - type: string - format: date-time - description: deposit_end_time is the end time for deposition. - total_deposit: - type: array - items: - 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: total_deposit is the total deposit on the proposal. - voting_start_time: - type: string - format: date-time - description: voting_start_time is the starting time to vote on a proposal. - voting_end_time: - type: string - format: date-time - description: voting_end_time is the end time of voting on a proposal. - metadata: - type: string - description: metadata is any arbitrary metadata attached to the proposal. - title: - type: string - description: 'Since: cosmos-sdk 0.47' - title: title is the title of the proposal - summary: - type: string - description: 'Since: cosmos-sdk 0.47' - title: summary is a short summary of the proposal - proposer: - type: string - description: 'Since: cosmos-sdk 0.47' - title: Proposer is the address of the proposal sumbitter - description: Proposal defines the core field members of a governance proposal. - cosmos.gov.v1.ProposalStatus: - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. - cosmos.gov.v1.QueryDepositResponse: - type: object - properties: - deposit: - description: deposit defines the requested deposit. - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - depositor: - type: string - description: depositor defines the deposit addresses from the proposals. - amount: - type: array - items: - 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: amount to be deposited by depositor. - description: >- - QueryDepositResponse is the response type for the Query/Deposit RPC - method. - cosmos.gov.v1.QueryDepositsResponse: - type: object - properties: - deposits: - type: array - items: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - depositor: - type: string - description: depositor defines the deposit addresses from the proposals. - amount: - type: array - items: - 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: amount to be deposited by depositor. - description: >- - Deposit defines an amount deposited by an account address to an - active - - proposal. - description: deposits defines the requested deposits. - 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: >- - QueryDepositsResponse is the response type for the Query/Deposits RPC - method. - cosmos.gov.v1.QueryParamsResponse: - type: object - properties: - voting_params: - description: |- - Deprecated: Prefer to use `params` instead. - voting_params defines the parameters related to voting. - type: object - properties: - voting_period: - type: string - description: Duration of the voting period. - deposit_params: - description: |- - Deprecated: Prefer to use `params` instead. - deposit_params defines the parameters related to deposit. - type: object - properties: - min_deposit: - type: array - items: - 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: Minimum deposit for a proposal to enter voting period. - max_deposit_period: - type: string - description: >- - Maximum period for Atom holders to deposit on a proposal. Initial - value: 2 - - months. - tally_params: - description: |- - Deprecated: Prefer to use `params` instead. - tally_params defines the parameters related to tally. - type: object - properties: - quorum: - type: string - description: >- - Minimum percentage of total stake needed to vote for a result to - be - - considered valid. - threshold: - type: string - description: >- - Minimum proportion of Yes votes for proposal to pass. Default - value: 0.5. - veto_threshold: - type: string - description: >- - Minimum value of Veto votes to Total votes ratio for proposal to - be - - vetoed. Default value: 1/3. - params: - description: |- - params defines all the paramaters of x/gov module. - - Since: cosmos-sdk 0.47 - type: object - properties: - min_deposit: - type: array - items: - 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: Minimum deposit for a proposal to enter voting period. - max_deposit_period: - type: string - description: >- - Maximum period for Atom holders to deposit on a proposal. Initial - value: 2 - - months. - voting_period: - type: string - description: Duration of the voting period. - quorum: - type: string - description: >- - Minimum percentage of total stake needed to vote for a result to - be - considered valid. - threshold: - type: string - description: >- - Minimum proportion of Yes votes for proposal to pass. Default - value: 0.5. - veto_threshold: - type: string - description: >- - Minimum value of Veto votes to Total votes ratio for proposal to - be - vetoed. Default value: 1/3. - min_initial_deposit_ratio: - type: string - description: >- - The ratio representing the proportion of the deposit value that - must be paid at proposal submission. - burn_vote_quorum: - type: boolean - title: burn deposits if a proposal does not meet quorum - burn_proposal_deposit_prevote: - type: boolean - title: burn deposits if the proposal does not enter voting period - burn_vote_veto: - type: boolean - title: burn deposits if quorum with vote type no_veto is met - description: QueryParamsResponse is the response type for the Query/Params RPC method. - cosmos.gov.v1.QueryProposalResponse: - type: object - properties: - proposal: - description: proposal is the requested governance proposal. - type: object - properties: - id: - type: string - format: uint64 - description: id defines the unique id of the proposal. - messages: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - messages are the arbitrary messages to be executed if the proposal - passes. - status: - description: status defines the proposal status. - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - final_tally_result: - description: >- - final_tally_result is the final tally result of the proposal. When - - querying a proposal via gRPC, this field is not populated until - the - - proposal's voting period has ended. - type: object - properties: - yes_count: - type: string - description: yes_count is the number of yes votes on a proposal. - abstain_count: - type: string - description: abstain_count is the number of abstain votes on a proposal. - no_count: - type: string - description: no_count is the number of no votes on a proposal. - no_with_veto_count: - type: string - description: >- - no_with_veto_count is the number of no with veto votes on a - proposal. - submit_time: - type: string - format: date-time - description: submit_time is the time of proposal submission. - deposit_end_time: - type: string - format: date-time - description: deposit_end_time is the end time for deposition. - total_deposit: - type: array - items: - 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: total_deposit is the total deposit on the proposal. - voting_start_time: - type: string - format: date-time - description: voting_start_time is the starting time to vote on a proposal. - voting_end_time: - type: string - format: date-time - description: voting_end_time is the end time of voting on a proposal. - metadata: - type: string - description: metadata is any arbitrary metadata attached to the proposal. - title: - type: string - description: 'Since: cosmos-sdk 0.47' - title: title is the title of the proposal - summary: - type: string - description: 'Since: cosmos-sdk 0.47' - title: summary is a short summary of the proposal - proposer: - type: string - description: 'Since: cosmos-sdk 0.47' - title: Proposer is the address of the proposal sumbitter - description: >- - QueryProposalResponse is the response type for the Query/Proposal RPC - method. - cosmos.gov.v1.QueryProposalsResponse: - type: object - properties: - proposals: - type: array - items: - type: object - properties: - id: - type: string - format: uint64 - description: id defines the unique id of the proposal. - messages: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - messages are the arbitrary messages to be executed if the - proposal passes. - status: - description: status defines the proposal status. - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - final_tally_result: - description: >- - final_tally_result is the final tally result of the proposal. - When - - querying a proposal via gRPC, this field is not populated until - the - - proposal's voting period has ended. - type: object - properties: - yes_count: - type: string - description: yes_count is the number of yes votes on a proposal. - abstain_count: - type: string - description: abstain_count is the number of abstain votes on a proposal. - no_count: - type: string - description: no_count is the number of no votes on a proposal. - no_with_veto_count: - type: string - description: >- - no_with_veto_count is the number of no with veto votes on a - proposal. - submit_time: - type: string - format: date-time - description: submit_time is the time of proposal submission. - deposit_end_time: - type: string - format: date-time - description: deposit_end_time is the end time for deposition. - total_deposit: - type: array - items: - 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: total_deposit is the total deposit on the proposal. - voting_start_time: - type: string - format: date-time - description: voting_start_time is the starting time to vote on a proposal. - voting_end_time: - type: string - format: date-time - description: voting_end_time is the end time of voting on a proposal. - metadata: - type: string - description: metadata is any arbitrary metadata attached to the proposal. - title: - type: string - description: 'Since: cosmos-sdk 0.47' - title: title is the title of the proposal - summary: - type: string - description: 'Since: cosmos-sdk 0.47' - title: summary is a short summary of the proposal - proposer: - type: string - description: 'Since: cosmos-sdk 0.47' - title: Proposer is the address of the proposal sumbitter - description: Proposal defines the core field members of a governance proposal. - description: proposals defines all the requested governance proposals. - 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: |- - QueryProposalsResponse is the response type for the Query/Proposals RPC - method. - cosmos.gov.v1.QueryTallyResultResponse: - type: object - properties: - tally: - description: tally defines the requested tally. - type: object - properties: - yes_count: - type: string - description: yes_count is the number of yes votes on a proposal. - abstain_count: - type: string - description: abstain_count is the number of abstain votes on a proposal. - no_count: - type: string - description: no_count is the number of no votes on a proposal. - no_with_veto_count: - type: string - description: >- - no_with_veto_count is the number of no with veto votes on a - proposal. - description: >- - QueryTallyResultResponse is the response type for the Query/Tally RPC - method. - cosmos.gov.v1.QueryVoteResponse: - type: object - properties: - vote: - description: vote defines the queried vote. - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - voter: - type: string - description: voter is the voter address of the proposal. - options: - type: array - items: - type: object - properties: - option: - description: >- - option defines the valid vote options, it must not contain - duplicate vote options. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - weight: - type: string - description: weight is the vote weight associated with the vote option. - description: WeightedVoteOption defines a unit of vote for vote split. - description: options is the weighted vote options. - metadata: - type: string - description: metadata is any arbitrary metadata to attached to the vote. - description: QueryVoteResponse is the response type for the Query/Vote RPC method. - cosmos.gov.v1.QueryVotesResponse: - type: object - properties: - votes: - type: array - items: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - voter: - type: string - description: voter is the voter address of the proposal. - options: - type: array - items: - type: object - properties: - option: - description: >- - option defines the valid vote options, it must not contain - duplicate vote options. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - weight: - type: string - description: weight is the vote weight associated with the vote option. - description: WeightedVoteOption defines a unit of vote for vote split. - description: options is the weighted vote options. - metadata: - type: string - description: metadata is any arbitrary metadata to attached to the vote. - description: |- - Vote defines a vote on a governance proposal. - A Vote consists of a proposal ID, the voter, and the vote option. - description: votes defines the queried votes. - 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: QueryVotesResponse is the response type for the Query/Votes RPC method. - cosmos.gov.v1.TallyParams: - type: object - properties: - quorum: - type: string - description: |- - Minimum percentage of total stake needed to vote for a result to be - considered valid. - threshold: - type: string - description: >- - Minimum proportion of Yes votes for proposal to pass. Default value: - 0.5. - veto_threshold: - type: string - description: |- - Minimum value of Veto votes to Total votes ratio for proposal to be - vetoed. Default value: 1/3. - description: TallyParams defines the params for tallying votes on governance proposals. - cosmos.gov.v1.TallyResult: - type: object - properties: - yes_count: - type: string - description: yes_count is the number of yes votes on a proposal. - abstain_count: - type: string - description: abstain_count is the number of abstain votes on a proposal. - no_count: - type: string - description: no_count is the number of no votes on a proposal. - no_with_veto_count: - type: string - description: no_with_veto_count is the number of no with veto votes on a proposal. - description: TallyResult defines a standard tally for a governance proposal. - cosmos.gov.v1.Vote: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - voter: - type: string - description: voter is the voter address of the proposal. - options: - type: array - items: - type: object - properties: - option: - description: >- - option defines the valid vote options, it must not contain - duplicate vote options. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - weight: - type: string - description: weight is the vote weight associated with the vote option. - description: WeightedVoteOption defines a unit of vote for vote split. - description: options is the weighted vote options. - metadata: - type: string - description: metadata is any arbitrary metadata to attached to the vote. - description: |- - Vote defines a vote on a governance proposal. - A Vote consists of a proposal ID, the voter, and the vote option. - cosmos.gov.v1.VotingParams: - type: object - properties: - voting_period: - type: string - description: Duration of the voting period. - description: VotingParams defines the params for voting on governance proposals. - cosmos.gov.v1beta1.Deposit: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - depositor: - type: string - description: depositor defines the deposit addresses from the proposals. - amount: - type: array - items: - 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: amount to be deposited by depositor. - description: |- - Deposit defines an amount deposited by an account address to an active - proposal. - cosmos.gov.v1beta1.DepositParams: - type: object - properties: - min_deposit: - type: array - items: - 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: Minimum deposit for a proposal to enter voting period. - max_deposit_period: - type: string - description: >- - Maximum period for Atom holders to deposit on a proposal. Initial - value: 2 - - months. - description: DepositParams defines the params for deposits on governance proposals. - cosmos.gov.v1beta1.Proposal: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - content: - description: content is the proposal's content. - type: object - properties: - '@type': - 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. - additionalProperties: {} - status: - description: status defines the proposal status. - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - final_tally_result: - description: |- - final_tally_result is the final tally result of the proposal. When - querying a proposal via gRPC, this field is not populated until the - proposal's voting period has ended. - type: object - properties: - 'yes': - type: string - description: yes is the number of yes votes on a proposal. - abstain: - type: string - description: abstain is the number of abstain votes on a proposal. - 'no': - type: string - description: no is the number of no votes on a proposal. - no_with_veto: - type: string - description: no_with_veto is the number of no with veto votes on a proposal. - submit_time: - type: string - format: date-time - description: submit_time is the time of proposal submission. - deposit_end_time: - type: string - format: date-time - description: deposit_end_time is the end time for deposition. - total_deposit: - type: array - items: - 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: total_deposit is the total deposit on the proposal. - voting_start_time: - type: string - format: date-time - description: voting_start_time is the starting time to vote on a proposal. - voting_end_time: - type: string - format: date-time - description: voting_end_time is the end time of voting on a proposal. - description: Proposal defines the core field members of a governance proposal. - cosmos.gov.v1beta1.ProposalStatus: - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. - cosmos.gov.v1beta1.QueryDepositResponse: - type: object - properties: - deposit: - description: deposit defines the requested deposit. - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - depositor: - type: string - description: depositor defines the deposit addresses from the proposals. - amount: - type: array - items: - 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: amount to be deposited by depositor. - description: >- - QueryDepositResponse is the response type for the Query/Deposit RPC - method. - cosmos.gov.v1beta1.QueryDepositsResponse: - type: object - properties: - deposits: - type: array - items: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - depositor: - type: string - description: depositor defines the deposit addresses from the proposals. - amount: - type: array - items: - 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: amount to be deposited by depositor. - description: >- - Deposit defines an amount deposited by an account address to an - active - - proposal. - description: deposits defines the requested deposits. - 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: >- - QueryDepositsResponse is the response type for the Query/Deposits RPC - method. - cosmos.gov.v1beta1.QueryParamsResponse: - type: object - properties: - voting_params: - description: voting_params defines the parameters related to voting. - type: object - properties: - voting_period: - type: string - description: Duration of the voting period. - deposit_params: - description: deposit_params defines the parameters related to deposit. - type: object - properties: - min_deposit: - type: array - items: - 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: Minimum deposit for a proposal to enter voting period. - max_deposit_period: - type: string - description: >- - Maximum period for Atom holders to deposit on a proposal. Initial - value: 2 - - months. - tally_params: - description: tally_params defines the parameters related to tally. - type: object - properties: - quorum: - type: string - format: byte - description: >- - Minimum percentage of total stake needed to vote for a result to - be - - considered valid. - threshold: - type: string - format: byte - description: >- - Minimum proportion of Yes votes for proposal to pass. Default - value: 0.5. - veto_threshold: - type: string - format: byte - description: >- - Minimum value of Veto votes to Total votes ratio for proposal to - be - - vetoed. Default value: 1/3. - description: QueryParamsResponse is the response type for the Query/Params RPC method. - cosmos.gov.v1beta1.QueryProposalResponse: - type: object - properties: - proposal: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - content: - description: content is the proposal's content. - type: object - properties: - '@type': - 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. - additionalProperties: {} - status: - description: status defines the proposal status. - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - final_tally_result: - description: >- - final_tally_result is the final tally result of the proposal. When - - querying a proposal via gRPC, this field is not populated until - the - - proposal's voting period has ended. - type: object - properties: - 'yes': - type: string - description: yes is the number of yes votes on a proposal. - abstain: - type: string - description: abstain is the number of abstain votes on a proposal. - 'no': - type: string - description: no is the number of no votes on a proposal. - no_with_veto: - type: string - description: >- - no_with_veto is the number of no with veto votes on a - proposal. - submit_time: - type: string - format: date-time - description: submit_time is the time of proposal submission. - deposit_end_time: - type: string - format: date-time - description: deposit_end_time is the end time for deposition. - total_deposit: - type: array - items: - 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: total_deposit is the total deposit on the proposal. - voting_start_time: - type: string - format: date-time - description: voting_start_time is the starting time to vote on a proposal. - voting_end_time: - type: string - format: date-time - description: voting_end_time is the end time of voting on a proposal. - description: Proposal defines the core field members of a governance proposal. - description: >- - QueryProposalResponse is the response type for the Query/Proposal RPC - method. - cosmos.gov.v1beta1.QueryProposalsResponse: - type: object - properties: - proposals: - type: array - items: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - content: - description: content is the proposal's content. - type: object - properties: - '@type': - 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. - additionalProperties: {} - status: - description: status defines the proposal status. - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - final_tally_result: - description: >- - final_tally_result is the final tally result of the proposal. - When - - querying a proposal via gRPC, this field is not populated until - the - - proposal's voting period has ended. - type: object - properties: - 'yes': - type: string - description: yes is the number of yes votes on a proposal. - abstain: - type: string - description: abstain is the number of abstain votes on a proposal. - 'no': - type: string - description: no is the number of no votes on a proposal. - no_with_veto: - type: string - description: >- - no_with_veto is the number of no with veto votes on a - proposal. - submit_time: - type: string - format: date-time - description: submit_time is the time of proposal submission. - deposit_end_time: - type: string - format: date-time - description: deposit_end_time is the end time for deposition. - total_deposit: - type: array - items: - 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: total_deposit is the total deposit on the proposal. - voting_start_time: - type: string - format: date-time - description: voting_start_time is the starting time to vote on a proposal. - voting_end_time: - type: string - format: date-time - description: voting_end_time is the end time of voting on a proposal. - description: Proposal defines the core field members of a governance proposal. - description: proposals defines all the requested governance proposals. - 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: |- - QueryProposalsResponse is the response type for the Query/Proposals RPC - method. - cosmos.gov.v1beta1.QueryTallyResultResponse: - type: object - properties: - tally: - description: tally defines the requested tally. - type: object - properties: - 'yes': - type: string - description: yes is the number of yes votes on a proposal. - abstain: - type: string - description: abstain is the number of abstain votes on a proposal. - 'no': - type: string - description: no is the number of no votes on a proposal. - no_with_veto: - type: string - description: no_with_veto is the number of no with veto votes on a proposal. - description: >- - QueryTallyResultResponse is the response type for the Query/Tally RPC - method. - cosmos.gov.v1beta1.QueryVoteResponse: - type: object - properties: - vote: - description: vote defines the queried vote. - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - voter: - type: string - description: voter is the voter address of the proposal. - option: - description: >- - Deprecated: Prefer to use `options` instead. This field is set in - queries - - if and only if `len(options) == 1` and that option has weight 1. - In all - - other cases, this field will default to VOTE_OPTION_UNSPECIFIED. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - options: - type: array - items: - type: object - properties: - option: - description: >- - option defines the valid vote options, it must not contain - duplicate vote options. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - weight: - type: string - description: weight is the vote weight associated with the vote option. - description: |- - WeightedVoteOption defines a unit of vote for vote split. - - Since: cosmos-sdk 0.43 - description: |- - options is the weighted vote options. - - Since: cosmos-sdk 0.43 - description: QueryVoteResponse is the response type for the Query/Vote RPC method. - cosmos.gov.v1beta1.QueryVotesResponse: - type: object - properties: - votes: - type: array - items: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - voter: - type: string - description: voter is the voter address of the proposal. - option: - description: >- - Deprecated: Prefer to use `options` instead. This field is set - in queries - - if and only if `len(options) == 1` and that option has weight 1. - In all - - other cases, this field will default to VOTE_OPTION_UNSPECIFIED. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - options: - type: array - items: - type: object - properties: - option: - description: >- - option defines the valid vote options, it must not contain - duplicate vote options. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - weight: - type: string - description: weight is the vote weight associated with the vote option. - description: |- - WeightedVoteOption defines a unit of vote for vote split. - - Since: cosmos-sdk 0.43 - description: |- - options is the weighted vote options. - - Since: cosmos-sdk 0.43 - description: |- - Vote defines a vote on a governance proposal. - A Vote consists of a proposal ID, the voter, and the vote option. - description: votes defines the queried votes. - 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: QueryVotesResponse is the response type for the Query/Votes RPC method. - cosmos.gov.v1beta1.TallyParams: - type: object - properties: - quorum: - type: string - format: byte - description: |- - Minimum percentage of total stake needed to vote for a result to be - considered valid. - threshold: - type: string - format: byte - description: >- - Minimum proportion of Yes votes for proposal to pass. Default value: - 0.5. - veto_threshold: - type: string - format: byte - description: |- - Minimum value of Veto votes to Total votes ratio for proposal to be - vetoed. Default value: 1/3. - description: TallyParams defines the params for tallying votes on governance proposals. - cosmos.gov.v1beta1.TallyResult: - type: object - properties: - 'yes': - type: string - description: yes is the number of yes votes on a proposal. - abstain: - type: string - description: abstain is the number of abstain votes on a proposal. - 'no': - type: string - description: no is the number of no votes on a proposal. - no_with_veto: - type: string - description: no_with_veto is the number of no with veto votes on a proposal. - description: TallyResult defines a standard tally for a governance proposal. - cosmos.gov.v1beta1.Vote: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - voter: - type: string - description: voter is the voter address of the proposal. - option: - description: >- - Deprecated: Prefer to use `options` instead. This field is set in - queries - - if and only if `len(options) == 1` and that option has weight 1. In - all - - other cases, this field will default to VOTE_OPTION_UNSPECIFIED. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - options: - type: array - items: - type: object - properties: - option: - description: >- - option defines the valid vote options, it must not contain - duplicate vote options. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - weight: - type: string - description: weight is the vote weight associated with the vote option. - description: |- - WeightedVoteOption defines a unit of vote for vote split. - - Since: cosmos-sdk 0.43 - description: |- - options is the weighted vote options. - - Since: cosmos-sdk 0.43 - description: |- - Vote defines a vote on a governance proposal. - A Vote consists of a proposal ID, the voter, and the vote option. - cosmos.gov.v1beta1.VoteOption: - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given governance - proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - 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.gov.v1beta1.VotingParams: - type: object - properties: - voting_period: - type: string - description: Duration of the voting period. - description: VotingParams defines the params for voting on governance proposals. - cosmos.gov.v1beta1.WeightedVoteOption: - type: object - properties: - option: - description: >- - option defines the valid vote options, it must not contain duplicate - vote options. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - weight: - type: string - description: weight is the vote weight associated with the vote option. - description: |- - WeightedVoteOption defines a unit of vote for vote split. - - Since: cosmos-sdk 0.43 - cosmos.gov.v1beta1.MsgDepositResponse: - type: object - description: MsgDepositResponse defines the Msg/Deposit response type. - cosmos.gov.v1beta1.MsgSubmitProposalResponse: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: proposal_id defines the unique id of the proposal. - description: MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. - cosmos.gov.v1beta1.MsgVoteResponse: - type: object - description: MsgVoteResponse defines the Msg/Vote response type. - cosmos.gov.v1beta1.MsgVoteWeightedResponse: - type: object - description: |- - MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. - - Since: cosmos-sdk 0.43 - cosmos.mint.v1beta1.Params: - type: object - properties: - mint_denom: - type: string - title: type of coin to mint - inflation_rate_change: - type: string - title: maximum annual change in inflation rate - inflation_max: - type: string - title: maximum inflation rate - inflation_min: - type: string - title: minimum inflation rate - goal_bonded: - type: string - title: goal of percent bonded atoms - blocks_per_year: - type: string - format: uint64 - title: expected blocks per year - description: Params defines the parameters for the x/mint module. - cosmos.mint.v1beta1.QueryAnnualProvisionsResponse: - type: object - properties: - annual_provisions: - type: string - format: byte - description: annual_provisions is the current minting annual provisions value. - description: |- - QueryAnnualProvisionsResponse is the response type for the - Query/AnnualProvisions RPC method. - cosmos.mint.v1beta1.QueryInflationResponse: - type: object - properties: - inflation: - type: string - format: byte - description: inflation is the current minting inflation value. - description: |- - QueryInflationResponse is the response type for the Query/Inflation RPC - method. - cosmos.mint.v1beta1.QueryParamsResponse: - type: object - properties: - params: - description: params defines the parameters of the module. - type: object - properties: - mint_denom: - type: string - title: type of coin to mint - inflation_rate_change: - type: string - title: maximum annual change in inflation rate - inflation_max: - type: string - title: maximum inflation rate - inflation_min: - type: string - title: minimum inflation rate - goal_bonded: - type: string - title: goal of percent bonded atoms - blocks_per_year: - type: string - format: uint64 - title: expected blocks per year - description: QueryParamsResponse is the response type for the Query/Params RPC method. - cosmos.mint.v1beta1.MsgUpdateParamsResponse: - type: object - description: |- - MsgUpdateParamsResponse defines the response structure for executing a - MsgUpdateParams message. - - Since: cosmos-sdk 0.47 - cosmos.nft.v1beta1.Class: - type: object - properties: - id: - type: string - title: >- - id defines the unique identifier of the NFT classification, similar to - the contract address of ERC721 - name: - type: string - title: >- - name defines the human-readable name of the NFT classification. - Optional - symbol: - type: string - title: symbol is an abbreviated name for nft classification. Optional - description: - type: string - title: description is a brief description of nft classification. Optional - uri: - type: string - title: >- - uri for the class metadata stored off chain. It can define schema for - Class and NFT `Data` attributes. Optional - uri_hash: - type: string - title: uri_hash is a hash of the document pointed by uri. Optional - data: - title: data is the app specific metadata of the NFT class. Optional - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: Class defines the class of the nft type. - cosmos.nft.v1beta1.NFT: - type: object - properties: - class_id: - type: string - title: >- - class_id associated with the NFT, similar to the contract address of - ERC721 - id: - type: string - title: id is a unique identifier of the NFT - uri: - type: string - title: uri for the NFT metadata stored off chain - uri_hash: - type: string - title: uri_hash is a hash of the document pointed by uri - data: - title: data is an app specific data of the NFT. Optional - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: NFT defines the NFT. - cosmos.nft.v1beta1.QueryBalanceResponse: - type: object - properties: - amount: - type: string - format: uint64 - title: amount is the number of all NFTs of a given class owned by the owner - title: QueryBalanceResponse is the response type for the Query/Balance RPC method - cosmos.nft.v1beta1.QueryClassResponse: - type: object - properties: - class: - description: class defines the class of the nft type. - type: object - properties: - id: - type: string - title: >- - id defines the unique identifier of the NFT classification, - similar to the contract address of ERC721 - name: - type: string - title: >- - name defines the human-readable name of the NFT classification. - Optional - symbol: - type: string - title: symbol is an abbreviated name for nft classification. Optional - description: - type: string - title: description is a brief description of nft classification. Optional - uri: - type: string - title: >- - uri for the class metadata stored off chain. It can define schema - for Class and NFT `Data` attributes. Optional - uri_hash: - type: string - title: uri_hash is a hash of the document pointed by uri. Optional - data: - title: data is the app specific metadata of the NFT class. Optional - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: QueryClassResponse is the response type for the Query/Class RPC method - cosmos.nft.v1beta1.QueryClassesResponse: - type: object - properties: - classes: - type: array - items: - type: object - properties: - id: - type: string - title: >- - id defines the unique identifier of the NFT classification, - similar to the contract address of ERC721 - name: - type: string - title: >- - name defines the human-readable name of the NFT classification. - Optional - symbol: - type: string - title: symbol is an abbreviated name for nft classification. Optional - description: - type: string - title: >- - description is a brief description of nft classification. - Optional - uri: - type: string - title: >- - uri for the class metadata stored off chain. It can define - schema for Class and NFT `Data` attributes. Optional - uri_hash: - type: string - title: uri_hash is a hash of the document pointed by uri. Optional - data: - title: data is the app specific metadata of the NFT class. Optional - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: Class defines the class of the nft type. - description: class defines the class of the nft type. - 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 - title: QueryClassesResponse is the response type for the Query/Classes RPC method - cosmos.nft.v1beta1.QueryNFTResponse: - type: object - properties: - nft: - title: owner is the owner address of the nft - type: object - properties: - class_id: - type: string - title: >- - class_id associated with the NFT, similar to the contract address - of ERC721 - id: - type: string - title: id is a unique identifier of the NFT - uri: - type: string - title: uri for the NFT metadata stored off chain - uri_hash: - type: string - title: uri_hash is a hash of the document pointed by uri - data: - title: data is an app specific data of the NFT. Optional - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: NFT defines the NFT. - title: QueryNFTResponse is the response type for the Query/NFT RPC method - cosmos.nft.v1beta1.QueryNFTsResponse: - type: object - properties: - nfts: - type: array - items: - type: object - properties: - class_id: - type: string - title: >- - class_id associated with the NFT, similar to the contract - address of ERC721 - id: - type: string - title: id is a unique identifier of the NFT - uri: - type: string - title: uri for the NFT metadata stored off chain - uri_hash: - type: string - title: uri_hash is a hash of the document pointed by uri - data: - title: data is an app specific data of the NFT. Optional - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: NFT defines the NFT. - title: NFT defines the NFT - 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 - title: QueryNFTsResponse is the response type for the Query/NFTs RPC methods - cosmos.nft.v1beta1.QueryOwnerResponse: - type: object - properties: - owner: - type: string - title: owner is the owner address of the nft - title: QueryOwnerResponse is the response type for the Query/Owner RPC method - cosmos.nft.v1beta1.QuerySupplyResponse: - type: object - properties: - amount: - type: string - format: uint64 - title: amount is the number of all NFTs from the given class - title: QuerySupplyResponse is the response type for the Query/Supply RPC method - cosmos.nft.v1beta1.MsgSendResponse: - type: object - description: MsgSendResponse defines the Msg/Send response type. - cosmos.params.v1beta1.ParamChange: - type: object - properties: - subspace: - type: string - key: - type: string - value: - type: string - description: |- - ParamChange defines an individual parameter change, for use in - ParameterChangeProposal. - cosmos.params.v1beta1.QueryParamsResponse: - type: object - properties: - param: - description: param defines the queried parameter. - type: object - properties: - subspace: - type: string - key: - type: string - value: - type: string - description: QueryParamsResponse is response type for the Query/Params RPC method. - cosmos.params.v1beta1.QuerySubspacesResponse: - type: object - properties: - subspaces: - type: array - items: - type: object - properties: - subspace: - type: string - keys: - type: array - items: - type: string - description: >- - Subspace defines a parameter subspace name and all the keys that - exist for - - the subspace. - - - Since: cosmos-sdk 0.46 - description: |- - QuerySubspacesResponse defines the response types for querying for all - registered subspaces and all keys for a subspace. - - Since: cosmos-sdk 0.46 - cosmos.params.v1beta1.Subspace: - type: object - properties: - subspace: - type: string - keys: - type: array - items: - type: string - description: |- - Subspace defines a parameter subspace name and all the keys that exist for - the subspace. - - Since: cosmos-sdk 0.46 - cosmos.slashing.v1beta1.Params: - type: object - properties: - signed_blocks_window: - type: string - format: int64 - min_signed_per_window: - type: string - format: byte - downtime_jail_duration: - type: string - slash_fraction_double_sign: - type: string - format: byte - slash_fraction_downtime: - type: string - format: byte - description: Params represents the parameters used for by the slashing module. - cosmos.slashing.v1beta1.QueryParamsResponse: - type: object - properties: - params: - type: object - properties: - signed_blocks_window: - type: string - format: int64 - min_signed_per_window: - type: string - format: byte - downtime_jail_duration: - type: string - slash_fraction_double_sign: - type: string - format: byte - slash_fraction_downtime: - type: string - format: byte - description: Params represents the parameters used for by the slashing module. - title: QueryParamsResponse is the response type for the Query/Params RPC method - cosmos.slashing.v1beta1.QuerySigningInfoResponse: - type: object - properties: - val_signing_info: - title: val_signing_info is the signing info of requested val cons address - type: object - properties: - address: - type: string - start_height: - type: string - format: int64 - title: Height at which validator was first a candidate OR was unjailed - index_offset: - type: string - format: int64 - description: >- - Index which is incremented each time the validator was a bonded - - in a block and may have signed a precommit or not. This in - conjunction with the - - `SignedBlocksWindow` param determines the index in the - `MissedBlocksBitArray`. - jailed_until: - type: string - format: date-time - description: >- - Timestamp until which the validator is jailed due to liveness - downtime. - tombstoned: - type: boolean - description: >- - 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 misbehiavor. - missed_blocks_counter: - type: string - format: int64 - description: >- - A counter kept to avoid unnecessary array reads. - - Note that `Sum(MissedBlocksBitArray)` always equals - `MissedBlocksCounter`. - description: >- - ValidatorSigningInfo defines a validator's signing info for monitoring - their - - liveness activity. - title: >- - QuerySigningInfoResponse is the response type for the Query/SigningInfo - RPC - - method - cosmos.slashing.v1beta1.QuerySigningInfosResponse: - type: object - properties: - info: - type: array - items: - type: object - properties: - address: - type: string - start_height: - type: string - format: int64 - title: Height at which validator was first a candidate OR was unjailed - index_offset: - type: string - format: int64 - description: >- - Index which is incremented each time the validator was a bonded - - in a block and may have signed a precommit or not. This in - conjunction with the - - `SignedBlocksWindow` param determines the index in the - `MissedBlocksBitArray`. - jailed_until: - type: string - format: date-time - description: >- - Timestamp until which the validator is jailed due to liveness - downtime. - tombstoned: - type: boolean - description: >- - 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 misbehiavor. - missed_blocks_counter: - type: string - format: int64 - description: >- - A counter kept to avoid unnecessary array reads. - - Note that `Sum(MissedBlocksBitArray)` always equals - `MissedBlocksCounter`. - description: >- - ValidatorSigningInfo defines a validator's signing info for - monitoring their - - liveness activity. - title: info is the signing info of all validators - pagination: - 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: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: >- - QuerySigningInfosResponse is the response type for the Query/SigningInfos - RPC - - method - cosmos.slashing.v1beta1.ValidatorSigningInfo: - type: object - properties: - address: - type: string - start_height: - type: string - format: int64 - title: Height at which validator was first a candidate OR was unjailed - index_offset: - type: string - format: int64 - description: >- - Index which is incremented each time the validator was a bonded - - in a block and may have signed a precommit or not. This in conjunction - with the - - `SignedBlocksWindow` param determines the index in the - `MissedBlocksBitArray`. - jailed_until: - type: string - format: date-time - description: >- - Timestamp until which the validator is jailed due to liveness - downtime. - tombstoned: - type: boolean - description: >- - 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 - misbehiavor. - missed_blocks_counter: - type: string - format: int64 - description: >- - A counter kept to avoid unnecessary array reads. - - Note that `Sum(MissedBlocksBitArray)` always equals - `MissedBlocksCounter`. - description: >- - ValidatorSigningInfo defines a validator's signing info for monitoring - their - - liveness activity. - cosmos.slashing.v1beta1.MsgUnjailResponse: - type: object - title: MsgUnjailResponse defines the Msg/Unjail response type - cosmos.slashing.v1beta1.MsgUpdateParamsResponse: - type: object - description: |- - MsgUpdateParamsResponse defines the response structure for executing a - MsgUpdateParams message. - - Since: cosmos-sdk 0.47 - cosmos.staking.v1beta1.BondStatus: - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - description: |- - BondStatus is the status of a validator. - - - BOND_STATUS_UNSPECIFIED: UNSPECIFIED defines an invalid validator status. - - BOND_STATUS_UNBONDED: UNBONDED defines a validator that is not bonded. - - BOND_STATUS_UNBONDING: UNBONDING defines a validator that is unbonding. - - BOND_STATUS_BONDED: BONDED defines a validator that is bonded. - cosmos.staking.v1beta1.Commission: - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates to be used for - creating a validator. - type: object - properties: - rate: - type: string - description: rate is the commission rate charged to delegators, as a fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which validator can - ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase of the - validator commission, as a fraction. - update_time: - type: string - format: date-time - description: update_time is the last time the commission rate was changed. - description: Commission defines commission parameters for a given validator. - cosmos.staking.v1beta1.CommissionRates: - type: object - properties: - rate: - type: string - description: rate is the commission rate charged to delegators, as a fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which validator can ever - charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase of the validator - commission, as a fraction. - description: >- - CommissionRates defines the initial commission rates to be used for - creating - - a validator. - cosmos.staking.v1beta1.Delegation: - type: object - properties: - delegator_address: - type: string - description: delegator_address is the bech32-encoded address of the delegator. - validator_address: - type: string - description: validator_address is the bech32-encoded address of the validator. - shares: - type: string - description: shares define the delegation shares received. - description: |- - Delegation represents the bond with tokens held by an account. It is - owned by one delegator, and is associated with the voting power of one - validator. - cosmos.staking.v1beta1.DelegationResponse: - type: object - properties: - delegation: - type: object - properties: - delegator_address: - type: string - description: delegator_address is the bech32-encoded address of the delegator. - validator_address: - type: string - description: validator_address is the bech32-encoded address of the validator. - shares: - type: string - description: shares define the delegation shares received. - description: |- - Delegation represents the bond with tokens held by an account. It is - owned by one delegator, and is associated with the voting power of one - validator. - 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: |- - DelegationResponse is equivalent to Delegation except that it contains a - balance in addition to shares which is more suitable for client responses. - cosmos.staking.v1beta1.Description: - type: object - properties: - moniker: - type: string - description: moniker defines a human-readable name for the validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. UPort or - Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: security_contact defines an optional email for security contact. - details: - type: string - description: details define other optional details. - description: Description defines a validator description. - cosmos.staking.v1beta1.HistoricalInfo: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block in - the blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - valset: - type: array - items: - type: object - properties: - operator_address: - type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the validator, - as a Protobuf Any. - type: object - properties: - '@type': - 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. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed from bonded - status or not. - status: - description: status is the validator status (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: tokens define the delegated tokens (incl. self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a validator's - delegators. - description: - description: description defines the description terms for the validator. - type: object - properties: - moniker: - type: string - description: moniker defines a human-readable name for the validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. UPort - or Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for security - contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which this - validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for the - validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates to be - used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to delegators, as a - fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase of - the validator commission, as a fraction. - update_time: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self declared minimum - self delegation. - - - Since: cosmos-sdk 0.46 - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - strictly positive if this validator's unbonding has been stopped - by external modules - unbonding_ids: - type: array - items: - type: string - format: uint64 - title: >- - list of unbonding ids, each uniquely identifing an unbonding of - this validator - description: >- - Validator defines a validator, together with the total amount of the - - Validator's bond shares and their exchange rate to coins. Slashing - results in - - a decrease in the exchange rate, allowing correct calculation of - future - - undelegations without iterating over delegators. When coins are - delegated to - - this validator, the validator is credited with a delegation whose - number of - - bond shares is based on the amount of coins delegated divided by the - current - - exchange rate. Voting power can be calculated as total bonded shares - - multiplied by exchange rate. - description: >- - HistoricalInfo contains header and validator information for a given - block. - - It is stored as part of staking module's state, which persists the `n` - most - - recent HistoricalInfo - - (`n` is set by the staking module's `historical_entries` parameter). - cosmos.staking.v1beta1.Params: - type: object - properties: - unbonding_time: - type: string - description: unbonding_time is the time duration of unbonding. - max_validators: - type: integer - format: int64 - description: max_validators is the maximum number of validators. - max_entries: - type: integer - format: int64 - description: >- - max_entries is the max entries for either unbonding delegation or - redelegation (per pair/trio). - historical_entries: - type: integer - format: int64 - description: historical_entries is the number of historical entries to persist. - bond_denom: - type: string - description: bond_denom defines the bondable coin denomination. - min_commission_rate: - type: string - title: >- - min_commission_rate is the chain-wide minimum commission rate that a - validator can charge their delegators - description: Params defines the parameters for the x/staking module. - cosmos.staking.v1beta1.Pool: - type: object - properties: - not_bonded_tokens: - type: string - bonded_tokens: - type: string - description: |- - Pool is used for tracking bonded and not-bonded token supply of the bond - denomination. - cosmos.staking.v1beta1.QueryDelegationResponse: - type: object - properties: - delegation_response: - description: delegation_responses defines the delegation info of a delegation. - type: object - properties: - delegation: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - shares: - type: string - description: shares define the delegation shares received. - description: >- - Delegation represents the bond with tokens held by an account. It - is - - owned by one delegator, and is associated with the voting power of - one - - validator. - 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: >- - QueryDelegationResponse is response type for the Query/Delegation RPC - method. - cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse: - type: object - properties: - delegation_responses: - type: array - items: - type: object - properties: - delegation: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - shares: - type: string - description: shares define the delegation shares received. - description: >- - Delegation represents the bond with tokens held by an account. - It is - - owned by one delegator, and is associated with the voting power - of one - - validator. - 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: >- - DelegationResponse is equivalent to Delegation except that it - contains a - - balance in addition to shares which is more suitable for client - responses. - description: delegation_responses defines all the delegations' info of a delegator. - 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: |- - QueryDelegatorDelegationsResponse is response type for the - Query/DelegatorDelegations RPC method. - cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse: - type: object - properties: - unbonding_responses: - type: array - items: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height is the height which the unbonding took - place. - completion_time: - type: string - format: date-time - description: completion_time is the unix time for unbonding completion. - initial_balance: - type: string - description: >- - initial_balance defines the tokens initially scheduled to - receive at completion. - balance: - type: string - description: balance defines the tokens to receive at completion. - unbonding_id: - type: string - format: uint64 - title: Incrementing id that uniquely identifies this entry - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - Strictly positive if this entry's unbonding has been - stopped by external modules - description: >- - UnbondingDelegationEntry defines an unbonding object with - relevant metadata. - description: |- - entries are the unbonding delegation entries. - - unbonding delegation entries - description: >- - UnbondingDelegation stores all of a single delegator's unbonding - bonds - - for a single validator in an time-ordered list. - 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: |- - QueryUnbondingDelegatorDelegationsResponse is response type for the - Query/UnbondingDelegatorDelegations RPC method. - cosmos.staking.v1beta1.QueryDelegatorValidatorResponse: - type: object - properties: - validator: - description: validator defines the validator info. - type: object - properties: - operator_address: - type: string - description: >- - operator_address defines the address of the validator's operator; - bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the validator, as - a Protobuf Any. - type: object - properties: - '@type': - 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. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed from bonded - status or not. - status: - description: status is the validator status (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: tokens define the delegated tokens (incl. self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a validator's - delegators. - description: - description: description defines the description terms for the validator. - type: object - properties: - moniker: - type: string - description: moniker defines a human-readable name for the validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. UPort or - Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for security - contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which this - validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for the - validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates to be - used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to delegators, as a - fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase of the - validator commission, as a fraction. - update_time: - type: string - format: date-time - description: update_time is the last time the commission rate was changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self declared minimum self - delegation. - - - Since: cosmos-sdk 0.46 - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - strictly positive if this validator's unbonding has been stopped - by external modules - unbonding_ids: - type: array - items: - type: string - format: uint64 - title: >- - list of unbonding ids, each uniquely identifing an unbonding of - this validator - description: |- - QueryDelegatorValidatorResponse response type for the - Query/DelegatorValidator RPC method. - cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse: - type: object - properties: - validators: - type: array - items: - type: object - properties: - operator_address: - type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the validator, - as a Protobuf Any. - type: object - properties: - '@type': - 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. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed from bonded - status or not. - status: - description: status is the validator status (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: tokens define the delegated tokens (incl. self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a validator's - delegators. - description: - description: description defines the description terms for the validator. - type: object - properties: - moniker: - type: string - description: moniker defines a human-readable name for the validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. UPort - or Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for security - contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which this - validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for the - validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates to be - used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to delegators, as a - fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase of - the validator commission, as a fraction. - update_time: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self declared minimum - self delegation. - - - Since: cosmos-sdk 0.46 - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - strictly positive if this validator's unbonding has been stopped - by external modules - unbonding_ids: - type: array - items: - type: string - format: uint64 - title: >- - list of unbonding ids, each uniquely identifing an unbonding of - this validator - description: >- - Validator defines a validator, together with the total amount of the - - Validator's bond shares and their exchange rate to coins. Slashing - results in - - a decrease in the exchange rate, allowing correct calculation of - future - - undelegations without iterating over delegators. When coins are - delegated to - - this validator, the validator is credited with a delegation whose - number of - - bond shares is based on the amount of coins delegated divided by the - current - - exchange rate. Voting power can be calculated as total bonded shares - - multiplied by exchange rate. - description: validators defines the validators' info of a delegator. - 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: |- - QueryDelegatorValidatorsResponse is response type for the - Query/DelegatorValidators RPC method. - cosmos.staking.v1beta1.QueryHistoricalInfoResponse: - type: object - properties: - hist: - description: hist defines the historical info at the given height. - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block - in the blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - valset: - type: array - items: - type: object - properties: - operator_address: - type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the - validator, as a Protobuf Any. - type: object - properties: - '@type': - 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. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed from - bonded status or not. - status: - description: status is the validator status (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: tokens define the delegated tokens (incl. self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a - validator's delegators. - description: - description: description defines the description terms for the validator. - type: object - properties: - moniker: - type: string - description: moniker defines a human-readable name for the validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. - UPort or Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for security - contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which - this validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for the - validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates to - be used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to delegators, - as a fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase - of the validator commission, as a fraction. - update_time: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self declared minimum - self delegation. - - - Since: cosmos-sdk 0.46 - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - strictly positive if this validator's unbonding has been - stopped by external modules - unbonding_ids: - type: array - items: - type: string - format: uint64 - title: >- - list of unbonding ids, each uniquely identifing an unbonding - of this validator - description: >- - Validator defines a validator, together with the total amount of - the - - Validator's bond shares and their exchange rate to coins. - Slashing results in - - a decrease in the exchange rate, allowing correct calculation of - future - - undelegations without iterating over delegators. When coins are - delegated to - - this validator, the validator is credited with a delegation - whose number of - - bond shares is based on the amount of coins delegated divided by - the current - - exchange rate. Voting power can be calculated as total bonded - shares - - multiplied by exchange rate. - description: >- - QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo - RPC - - method. - cosmos.staking.v1beta1.QueryParamsResponse: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - properties: - unbonding_time: - type: string - description: unbonding_time is the time duration of unbonding. - max_validators: - type: integer - format: int64 - description: max_validators is the maximum number of validators. - max_entries: - type: integer - format: int64 - description: >- - max_entries is the max entries for either unbonding delegation or - redelegation (per pair/trio). - historical_entries: - type: integer - format: int64 - description: historical_entries is the number of historical entries to persist. - bond_denom: - type: string - description: bond_denom defines the bondable coin denomination. - min_commission_rate: - type: string - title: >- - min_commission_rate is the chain-wide minimum commission rate that - a validator can charge their delegators - description: QueryParamsResponse is response type for the Query/Params RPC method. - cosmos.staking.v1beta1.QueryPoolResponse: - type: object - properties: - pool: - description: pool defines the pool info. - type: object - properties: - not_bonded_tokens: - type: string - bonded_tokens: - type: string - description: QueryPoolResponse is response type for the Query/Pool RPC method. - cosmos.staking.v1beta1.QueryRedelegationsResponse: - type: object - properties: - redelegation_responses: - type: array - items: - type: object - properties: - redelegation: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_src_address: - type: string - description: >- - validator_src_address is the validator redelegation source - operator address. - validator_dst_address: - type: string - description: >- - validator_dst_address is the validator redelegation - destination operator address. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height defines the height which the - redelegation took place. - completion_time: - type: string - format: date-time - description: >- - completion_time defines the unix time for redelegation - completion. - initial_balance: - type: string - description: >- - initial_balance defines the initial balance when - redelegation started. - shares_dst: - type: string - description: >- - shares_dst is the amount of destination-validator - shares created by redelegation. - unbonding_id: - type: string - format: uint64 - title: Incrementing id that uniquely identifies this entry - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - Strictly positive if this entry's unbonding has been - stopped by external modules - description: >- - RedelegationEntry defines a redelegation object with - relevant metadata. - description: |- - entries are the redelegation entries. - - redelegation entries - description: >- - Redelegation contains the list of a particular delegator's - redelegating bonds - - from a particular source validator to a particular destination - validator. - entries: - type: array - items: - type: object - properties: - redelegation_entry: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height defines the height which the - redelegation took place. - completion_time: - type: string - format: date-time - description: >- - completion_time defines the unix time for redelegation - completion. - initial_balance: - type: string - description: >- - initial_balance defines the initial balance when - redelegation started. - shares_dst: - type: string - description: >- - shares_dst is the amount of destination-validator - shares created by redelegation. - unbonding_id: - type: string - format: uint64 - title: Incrementing id that uniquely identifies this entry - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - Strictly positive if this entry's unbonding has been - stopped by external modules - description: >- - RedelegationEntry defines a redelegation object with - relevant metadata. - balance: - type: string - description: >- - RedelegationEntryResponse is equivalent to a RedelegationEntry - except that it - - contains a balance in addition to shares which is more - suitable for client - - responses. - description: >- - RedelegationResponse is equivalent to a Redelegation except that its - entries - - contain a balance in addition to shares which is more suitable for - client - - responses. - 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: >- - QueryRedelegationsResponse is response type for the Query/Redelegations - RPC - - method. - cosmos.staking.v1beta1.QueryUnbondingDelegationResponse: - type: object - properties: - unbond: - description: unbond defines the unbonding information of a delegation. - type: object - properties: - delegator_address: - type: string - description: delegator_address is the bech32-encoded address of the delegator. - validator_address: - type: string - description: validator_address is the bech32-encoded address of the validator. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height is the height which the unbonding took - place. - completion_time: - type: string - format: date-time - description: completion_time is the unix time for unbonding completion. - initial_balance: - type: string - description: >- - initial_balance defines the tokens initially scheduled to - receive at completion. - balance: - type: string - description: balance defines the tokens to receive at completion. - unbonding_id: - type: string - format: uint64 - title: Incrementing id that uniquely identifies this entry - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - Strictly positive if this entry's unbonding has been stopped - by external modules - description: >- - UnbondingDelegationEntry defines an unbonding object with - relevant metadata. - description: |- - entries are the unbonding delegation entries. - - unbonding delegation entries - description: |- - QueryDelegationResponse is response type for the Query/UnbondingDelegation - RPC method. - cosmos.staking.v1beta1.QueryValidatorDelegationsResponse: - type: object - properties: - delegation_responses: - type: array - items: - type: object - properties: - delegation: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - shares: - type: string - description: shares define the delegation shares received. - description: >- - Delegation represents the bond with tokens held by an account. - It is - - owned by one delegator, and is associated with the voting power - of one - - validator. - 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: >- - DelegationResponse is equivalent to Delegation except that it - contains a - - balance in addition to shares which is more suitable for client - responses. - 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 - title: |- - QueryValidatorDelegationsResponse is response type for the - Query/ValidatorDelegations RPC method - cosmos.staking.v1beta1.QueryValidatorResponse: - type: object - properties: - validator: - description: validator defines the validator info. - type: object - properties: - operator_address: - type: string - description: >- - operator_address defines the address of the validator's operator; - bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the validator, as - a Protobuf Any. - type: object - properties: - '@type': - 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. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed from bonded - status or not. - status: - description: status is the validator status (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: tokens define the delegated tokens (incl. self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a validator's - delegators. - description: - description: description defines the description terms for the validator. - type: object - properties: - moniker: - type: string - description: moniker defines a human-readable name for the validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. UPort or - Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for security - contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which this - validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for the - validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates to be - used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to delegators, as a - fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase of the - validator commission, as a fraction. - update_time: - type: string - format: date-time - description: update_time is the last time the commission rate was changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self declared minimum self - delegation. - - - Since: cosmos-sdk 0.46 - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - strictly positive if this validator's unbonding has been stopped - by external modules - unbonding_ids: - type: array - items: - type: string - format: uint64 - title: >- - list of unbonding ids, each uniquely identifing an unbonding of - this validator - title: QueryValidatorResponse is response type for the Query/Validator RPC method - cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse: - type: object - properties: - unbonding_responses: - type: array - items: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height is the height which the unbonding took - place. - completion_time: - type: string - format: date-time - description: completion_time is the unix time for unbonding completion. - initial_balance: - type: string - description: >- - initial_balance defines the tokens initially scheduled to - receive at completion. - balance: - type: string - description: balance defines the tokens to receive at completion. - unbonding_id: - type: string - format: uint64 - title: Incrementing id that uniquely identifies this entry - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - Strictly positive if this entry's unbonding has been - stopped by external modules - description: >- - UnbondingDelegationEntry defines an unbonding object with - relevant metadata. - description: |- - entries are the unbonding delegation entries. - - unbonding delegation entries - description: >- - UnbondingDelegation stores all of a single delegator's unbonding - bonds - - for a single validator in an time-ordered list. - 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: |- - QueryValidatorUnbondingDelegationsResponse is response type for the - Query/ValidatorUnbondingDelegations RPC method. - cosmos.staking.v1beta1.QueryValidatorsResponse: - type: object - properties: - validators: - type: array - items: - type: object - properties: - operator_address: - type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the validator, - as a Protobuf Any. - type: object - properties: - '@type': - 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. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed from bonded - status or not. - status: - description: status is the validator status (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: tokens define the delegated tokens (incl. self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a validator's - delegators. - description: - description: description defines the description terms for the validator. - type: object - properties: - moniker: - type: string - description: moniker defines a human-readable name for the validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. UPort - or Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for security - contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which this - validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for the - validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates to be - used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to delegators, as a - fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase of - the validator commission, as a fraction. - update_time: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self declared minimum - self delegation. - - - Since: cosmos-sdk 0.46 - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - strictly positive if this validator's unbonding has been stopped - by external modules - unbonding_ids: - type: array - items: - type: string - format: uint64 - title: >- - list of unbonding ids, each uniquely identifing an unbonding of - this validator - description: >- - Validator defines a validator, together with the total amount of the - - Validator's bond shares and their exchange rate to coins. Slashing - results in - - a decrease in the exchange rate, allowing correct calculation of - future - - undelegations without iterating over delegators. When coins are - delegated to - - this validator, the validator is credited with a delegation whose - number of - - bond shares is based on the amount of coins delegated divided by the - current - - exchange rate. Voting power can be calculated as total bonded shares - - multiplied by exchange rate. - description: validators contains all the queried validators. - 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 - title: >- - QueryValidatorsResponse is response type for the Query/Validators RPC - method - cosmos.staking.v1beta1.Redelegation: - type: object - properties: - delegator_address: - type: string - description: delegator_address is the bech32-encoded address of the delegator. - validator_src_address: - type: string - description: >- - validator_src_address is the validator redelegation source operator - address. - validator_dst_address: - type: string - description: >- - validator_dst_address is the validator redelegation destination - operator address. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height defines the height which the redelegation took - place. - completion_time: - type: string - format: date-time - description: >- - completion_time defines the unix time for redelegation - completion. - initial_balance: - type: string - description: >- - initial_balance defines the initial balance when redelegation - started. - shares_dst: - type: string - description: >- - shares_dst is the amount of destination-validator shares created - by redelegation. - unbonding_id: - type: string - format: uint64 - title: Incrementing id that uniquely identifies this entry - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - Strictly positive if this entry's unbonding has been stopped by - external modules - description: >- - RedelegationEntry defines a redelegation object with relevant - metadata. - description: |- - entries are the redelegation entries. - - redelegation entries - description: >- - Redelegation contains the list of a particular delegator's redelegating - bonds - - from a particular source validator to a particular destination validator. - cosmos.staking.v1beta1.RedelegationEntry: - type: object - properties: - creation_height: - type: string - format: int64 - description: creation_height defines the height which the redelegation took place. - completion_time: - type: string - format: date-time - description: completion_time defines the unix time for redelegation completion. - initial_balance: - type: string - description: initial_balance defines the initial balance when redelegation started. - shares_dst: - type: string - description: >- - shares_dst is the amount of destination-validator shares created by - redelegation. - unbonding_id: - type: string - format: uint64 - title: Incrementing id that uniquely identifies this entry - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - Strictly positive if this entry's unbonding has been stopped by - external modules - description: RedelegationEntry defines a redelegation object with relevant metadata. - cosmos.staking.v1beta1.RedelegationEntryResponse: - type: object - properties: - redelegation_entry: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height defines the height which the redelegation took - place. - completion_time: - type: string - format: date-time - description: completion_time defines the unix time for redelegation completion. - initial_balance: - type: string - description: >- - initial_balance defines the initial balance when redelegation - started. - shares_dst: - type: string - description: >- - shares_dst is the amount of destination-validator shares created - by redelegation. - unbonding_id: - type: string - format: uint64 - title: Incrementing id that uniquely identifies this entry - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - Strictly positive if this entry's unbonding has been stopped by - external modules - description: >- - RedelegationEntry defines a redelegation object with relevant - metadata. - balance: - type: string - description: >- - RedelegationEntryResponse is equivalent to a RedelegationEntry except that - it - - contains a balance in addition to shares which is more suitable for client - - responses. - cosmos.staking.v1beta1.RedelegationResponse: - type: object - properties: - redelegation: - type: object - properties: - delegator_address: - type: string - description: delegator_address is the bech32-encoded address of the delegator. - validator_src_address: - type: string - description: >- - validator_src_address is the validator redelegation source - operator address. - validator_dst_address: - type: string - description: >- - validator_dst_address is the validator redelegation destination - operator address. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height defines the height which the redelegation - took place. - completion_time: - type: string - format: date-time - description: >- - completion_time defines the unix time for redelegation - completion. - initial_balance: - type: string - description: >- - initial_balance defines the initial balance when - redelegation started. - shares_dst: - type: string - description: >- - shares_dst is the amount of destination-validator shares - created by redelegation. - unbonding_id: - type: string - format: uint64 - title: Incrementing id that uniquely identifies this entry - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - Strictly positive if this entry's unbonding has been stopped - by external modules - description: >- - RedelegationEntry defines a redelegation object with relevant - metadata. - description: |- - entries are the redelegation entries. - - redelegation entries - description: >- - Redelegation contains the list of a particular delegator's - redelegating bonds - - from a particular source validator to a particular destination - validator. - entries: - type: array - items: - type: object - properties: - redelegation_entry: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height defines the height which the redelegation - took place. - completion_time: - type: string - format: date-time - description: >- - completion_time defines the unix time for redelegation - completion. - initial_balance: - type: string - description: >- - initial_balance defines the initial balance when - redelegation started. - shares_dst: - type: string - description: >- - shares_dst is the amount of destination-validator shares - created by redelegation. - unbonding_id: - type: string - format: uint64 - title: Incrementing id that uniquely identifies this entry - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - Strictly positive if this entry's unbonding has been stopped - by external modules - description: >- - RedelegationEntry defines a redelegation object with relevant - metadata. - balance: - type: string - description: >- - RedelegationEntryResponse is equivalent to a RedelegationEntry - except that it - - contains a balance in addition to shares which is more suitable for - client - - responses. - description: >- - RedelegationResponse is equivalent to a Redelegation except that its - entries - - contain a balance in addition to shares which is more suitable for client - - responses. - cosmos.staking.v1beta1.UnbondingDelegation: - type: object - properties: - delegator_address: - type: string - description: delegator_address is the bech32-encoded address of the delegator. - validator_address: - type: string - description: validator_address is the bech32-encoded address of the validator. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: creation_height is the height which the unbonding took place. - completion_time: - type: string - format: date-time - description: completion_time is the unix time for unbonding completion. - initial_balance: - type: string - description: >- - initial_balance defines the tokens initially scheduled to - receive at completion. - balance: - type: string - description: balance defines the tokens to receive at completion. - unbonding_id: - type: string - format: uint64 - title: Incrementing id that uniquely identifies this entry - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - Strictly positive if this entry's unbonding has been stopped by - external modules - description: >- - UnbondingDelegationEntry defines an unbonding object with relevant - metadata. - description: |- - entries are the unbonding delegation entries. - - unbonding delegation entries - description: |- - UnbondingDelegation stores all of a single delegator's unbonding bonds - for a single validator in an time-ordered list. - cosmos.staking.v1beta1.UnbondingDelegationEntry: - type: object - properties: - creation_height: - type: string - format: int64 - description: creation_height is the height which the unbonding took place. - completion_time: - type: string - format: date-time - description: completion_time is the unix time for unbonding completion. - initial_balance: - type: string - description: >- - initial_balance defines the tokens initially scheduled to receive at - completion. - balance: - type: string - description: balance defines the tokens to receive at completion. - unbonding_id: - type: string - format: uint64 - title: Incrementing id that uniquely identifies this entry - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - Strictly positive if this entry's unbonding has been stopped by - external modules - description: >- - UnbondingDelegationEntry defines an unbonding object with relevant - metadata. - cosmos.staking.v1beta1.Validator: - type: object - properties: - operator_address: - type: string - description: >- - operator_address defines the address of the validator's operator; bech - encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the validator, as a - Protobuf Any. - type: object - properties: - '@type': - 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. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed from bonded - status or not. - status: - description: status is the validator status (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: tokens define the delegated tokens (incl. self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a validator's - delegators. - description: - description: description defines the description terms for the validator. - type: object - properties: - moniker: - type: string - description: moniker defines a human-readable name for the validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. UPort or - Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: security_contact defines an optional email for security contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which this - validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for the validator - to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates to be used - for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to delegators, as a - fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which validator - can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase of the - validator commission, as a fraction. - update_time: - type: string - format: date-time - description: update_time is the last time the commission rate was changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self declared minimum self - delegation. - - - Since: cosmos-sdk 0.46 - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - strictly positive if this validator's unbonding has been stopped by - external modules - unbonding_ids: - type: array - items: - type: string - format: uint64 - title: >- - list of unbonding ids, each uniquely identifing an unbonding of this - validator - description: >- - Validator defines a validator, together with the total amount of the - - Validator's bond shares and their exchange rate to coins. Slashing results - in - - a decrease in the exchange rate, allowing correct calculation of future - - undelegations without iterating over delegators. When coins are delegated - to - - this validator, the validator is credited with a delegation whose number - of - - bond shares is based on the amount of coins delegated divided by the - current - - exchange rate. Voting power can be calculated as total bonded shares - - multiplied by exchange rate. - cosmos.staking.v1beta1.MsgBeginRedelegateResponse: - type: object - properties: - completion_time: - type: string - format: date-time - description: MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. - cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse: - type: object - description: 'Since: cosmos-sdk 0.46' - title: MsgCancelUnbondingDelegationResponse - cosmos.staking.v1beta1.MsgCreateValidatorResponse: - type: object - description: MsgCreateValidatorResponse defines the Msg/CreateValidator response type. - cosmos.staking.v1beta1.MsgDelegateResponse: - type: object - description: MsgDelegateResponse defines the Msg/Delegate response type. - cosmos.staking.v1beta1.MsgEditValidatorResponse: - type: object - description: MsgEditValidatorResponse defines the Msg/EditValidator response type. - cosmos.staking.v1beta1.MsgUndelegateResponse: - type: object - properties: - completion_time: - type: string - format: date-time - description: MsgUndelegateResponse defines the Msg/Undelegate response type. - cosmos.staking.v1beta1.MsgUpdateParamsResponse: - type: object - description: |- - MsgUpdateParamsResponse defines the response structure for executing a - MsgUpdateParams message. - - Since: cosmos-sdk 0.47 - cosmos.base.abci.v1beta1.ABCIMessageLog: - type: object - properties: - msg_index: - type: integer - format: int64 - log: - type: string - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - description: >- - Attribute defines an attribute wrapper where the key and value - are - - strings instead of raw bytes. - description: |- - StringEvent defines en Event object wrapper where all the attributes - contain key/value pairs that are strings instead of raw bytes. - description: |- - Events contains a slice of Event objects that were emitted during some - execution. - description: >- - ABCIMessageLog defines a structure containing an indexed tx ABCI message - log. - cosmos.base.abci.v1beta1.Attribute: - type: object - properties: - key: - type: string - value: - type: string - description: |- - Attribute defines an attribute wrapper where the key and value are - strings instead of raw bytes. - cosmos.base.abci.v1beta1.GasInfo: - type: object - properties: - gas_wanted: - type: string - format: uint64 - description: GasWanted is the maximum units of work we allow this tx to perform. - gas_used: - type: string - format: uint64 - description: GasUsed is the amount of gas actually consumed. - description: GasInfo defines tx execution gas context. - cosmos.base.abci.v1beta1.Result: - type: object - properties: - data: - type: string - format: byte - description: >- - Data is any data returned from message or handler execution. It MUST - be - - length prefixed in order to separate data from multiple message - executions. - - Deprecated. This field is still populated, but prefer msg_response - instead - - because it also contains the Msg response typeURL. - log: - type: string - description: Log contains the log information from message or handler execution. - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - index: - type: boolean - title: nondeterministic - description: >- - EventAttribute is a single key-value pair, associated with an - event. - description: >- - Event allows application developers to attach additional information - to - - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and - ResponseDeliverTx. - - Later, transactions may be queried using these events. - description: >- - Events contains a slice of Event objects that were emitted during - message - - or handler execution. - msg_responses: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: |- - msg_responses contains the Msg handler responses type packed in Anys. - - Since: cosmos-sdk 0.46 - description: Result is the union of ResponseFormat and ResponseCheckTx. - cosmos.base.abci.v1beta1.StringEvent: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - description: |- - Attribute defines an attribute wrapper where the key and value are - strings instead of raw bytes. - description: |- - StringEvent defines en Event object wrapper where all the attributes - contain key/value pairs that are strings instead of raw bytes. - cosmos.base.abci.v1beta1.TxResponse: - type: object - properties: - height: - type: string - format: int64 - title: The block height - txhash: - type: string - description: The transaction hash. - codespace: - type: string - title: Namespace for the Code - code: - type: integer - format: int64 - description: Response code. - data: - type: string - description: Result bytes, if any. - raw_log: - type: string - description: |- - The output of the application's logger (raw string). May be - non-deterministic. - logs: - type: array - items: - type: object - properties: - msg_index: - type: integer - format: int64 - log: - type: string - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - description: >- - Attribute defines an attribute wrapper where the key and - value are - - strings instead of raw bytes. - description: >- - StringEvent defines en Event object wrapper where all the - attributes - - contain key/value pairs that are strings instead of raw bytes. - description: >- - Events contains a slice of Event objects that were emitted - during some - - execution. - description: >- - ABCIMessageLog defines a structure containing an indexed tx ABCI - message log. - description: >- - The output of the application's logger (typed). May be - non-deterministic. - info: - type: string - description: Additional information. May be non-deterministic. - gas_wanted: - type: string - format: int64 - description: Amount of gas requested for transaction. - gas_used: - type: string - format: int64 - description: Amount of gas consumed by transaction. - tx: - description: The request transaction bytes. - type: object - properties: - '@type': - 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. - additionalProperties: {} - timestamp: - type: string - description: >- - Time of the previous block. For heights > 1, it's the weighted median - of - - the timestamps of the valid votes in the block.LastCommit. For height - == 1, - - it's genesis time. - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - index: - type: boolean - title: nondeterministic - description: >- - EventAttribute is a single key-value pair, associated with an - event. - description: >- - Event allows application developers to attach additional information - to - - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and - ResponseDeliverTx. - - Later, transactions may be queried using these events. - description: >- - Events defines all the events emitted by processing a transaction. - Note, - - these events include those emitted by processing all the messages and - those - - emitted from the ante. Whereas Logs contains the events, with - - additional metadata, emitted only by processing the messages. - - - Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - description: >- - TxResponse defines a structure containing relevant tx data and metadata. - The - - tags are stringified and the log is JSON decoded. - cosmos.crypto.multisig.v1beta1.CompactBitArray: - type: object - properties: - extra_bits_stored: - type: integer - format: int64 - elems: - type: string - format: byte - description: |- - CompactBitArray is an implementation of a space efficient bit array. - This is used to ensure that the encoded data takes up a minimal amount of - space after proto encoding. - This is not thread safe, and is not intended for concurrent usage. - cosmos.tx.signing.v1beta1.SignMode: - type: string - enum: - - SIGN_MODE_UNSPECIFIED - - SIGN_MODE_DIRECT - - SIGN_MODE_TEXTUAL - - SIGN_MODE_DIRECT_AUX - - SIGN_MODE_LEGACY_AMINO_JSON - - SIGN_MODE_EIP_191 - default: SIGN_MODE_UNSPECIFIED - description: |- - SignMode represents a signing mode with its own security guarantees. - - This enum should be considered a registry of all known sign modes - in the Cosmos ecosystem. Apps are not expected to support all known - sign modes. Apps that would like to support custom sign modes are - encouraged to open a small PR against this file to add a new case - to this SignMode enum describing their sign mode so that different - apps have a consistent version of this enum. - - - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - rejected. - - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - 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 not supported. - - 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. - - Since: cosmos-sdk 0.46 - - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - Amino JSON and will be removed in the future. - - SIGN_MODE_EIP_191: SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos - SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 - - Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, - but is not implemented on the SDK by default. To enable EIP-191, you need - to pass a custom `TxConfig` that has an implementation of - `SignModeHandler` for EIP-191. The SDK may decide to fully support - EIP-191 in the future. - - Since: cosmos-sdk 0.45.2 - cosmos.tx.v1beta1.AuthInfo: - type: object - properties: - signer_infos: - type: array - items: - type: object - $ref: '#/definitions/cosmos.tx.v1beta1.SignerInfo' - description: >- - signer_infos defines the signing modes for the required signers. The - number - - and order of elements must match the required signers from TxBody's - - messages. The first element is the primary signer and the one which - pays - - the fee. - fee: - description: >- - Fee is the fee and gas limit for the transaction. The first signer is - the - - primary signer and the one which pays the fee. The fee can be - calculated - - based on the cost of evaluating the body and doing signature - verification - - of the signers. This can be estimated via simulation. - type: object - properties: - amount: - type: array - items: - 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. - title: amount is the amount of coins to be paid as a fee - gas_limit: - type: string - format: uint64 - title: >- - gas_limit is the maximum gas that can be used in transaction - processing - - before an out of gas error occurs - payer: - type: string - description: >- - 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. - granter: - type: string - title: >- - 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 - tip: - description: >- - 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 - type: object - properties: - amount: - type: array - items: - 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. - title: amount is the amount of the tip - tipper: - type: string - title: tipper is the address of the account paying for the tip - description: |- - AuthInfo describes the fee and signer modes that are used to sign a - transaction. - cosmos.tx.v1beta1.BroadcastMode: - type: string - enum: - - BROADCAST_MODE_UNSPECIFIED - - BROADCAST_MODE_BLOCK - - BROADCAST_MODE_SYNC - - BROADCAST_MODE_ASYNC - default: BROADCAST_MODE_UNSPECIFIED - description: >- - BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC - method. - - - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering - - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, - BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. - - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for - a CheckTx execution response only. - - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns - immediately. - cosmos.tx.v1beta1.BroadcastTxRequest: - type: object - properties: - tx_bytes: - type: string - format: byte - description: tx_bytes is the raw transaction. - mode: - type: string - enum: - - BROADCAST_MODE_UNSPECIFIED - - BROADCAST_MODE_BLOCK - - BROADCAST_MODE_SYNC - - BROADCAST_MODE_ASYNC - default: BROADCAST_MODE_UNSPECIFIED - description: >- - BroadcastMode specifies the broadcast mode for the TxService.Broadcast - RPC method. - - - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering - - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, - BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. - - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for - a CheckTx execution response only. - - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns - immediately. - description: |- - BroadcastTxRequest is the request type for the Service.BroadcastTxRequest - RPC method. - cosmos.tx.v1beta1.BroadcastTxResponse: - type: object - properties: - tx_response: - description: tx_response is the queried TxResponses. - type: object - properties: - height: - type: string - format: int64 - title: The block height - txhash: - type: string - description: The transaction hash. - codespace: - type: string - title: Namespace for the Code - code: - type: integer - format: int64 - description: Response code. - data: - type: string - description: Result bytes, if any. - raw_log: - type: string - description: |- - The output of the application's logger (raw string). May be - non-deterministic. - logs: - type: array - items: - type: object - properties: - msg_index: - type: integer - format: int64 - log: - type: string - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - description: >- - Attribute defines an attribute wrapper where the key - and value are - - strings instead of raw bytes. - description: >- - StringEvent defines en Event object wrapper where all the - attributes - - contain key/value pairs that are strings instead of raw - bytes. - description: >- - Events contains a slice of Event objects that were emitted - during some - - execution. - description: >- - ABCIMessageLog defines a structure containing an indexed tx ABCI - message log. - description: >- - The output of the application's logger (typed). May be - non-deterministic. - info: - type: string - description: Additional information. May be non-deterministic. - gas_wanted: - type: string - format: int64 - description: Amount of gas requested for transaction. - gas_used: - type: string - format: int64 - description: Amount of gas consumed by transaction. - tx: - description: The request transaction bytes. - type: object - properties: - '@type': - 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. - additionalProperties: {} - timestamp: - type: string - description: >- - Time of the previous block. For heights > 1, it's the weighted - median of - - the timestamps of the valid votes in the block.LastCommit. For - height == 1, - - it's genesis time. - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - index: - type: boolean - title: nondeterministic - description: >- - EventAttribute is a single key-value pair, associated with - an event. - description: >- - Event allows application developers to attach additional - information to - - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and - ResponseDeliverTx. - - Later, transactions may be queried using these events. - description: >- - Events defines all the events emitted by processing a transaction. - Note, - - these events include those emitted by processing all the messages - and those - - emitted from the ante. Whereas Logs contains the events, with - - additional metadata, emitted only by processing the messages. - - - Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - description: |- - BroadcastTxResponse is the response type for the - Service.BroadcastTx method. - cosmos.tx.v1beta1.Fee: - type: object - properties: - amount: - type: array - items: - 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. - title: amount is the amount of coins to be paid as a fee - gas_limit: - type: string - format: uint64 - title: >- - gas_limit is the maximum gas that can be used in transaction - processing - - before an out of gas error occurs - payer: - type: string - description: >- - 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. - granter: - type: string - title: >- - 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 - description: >- - Fee includes the amount of coins paid in fees and the maximum - - gas to be used by the transaction. The ratio yields an effective - "gasprice", - - which must be above some miminum to be accepted into the mempool. - cosmos.tx.v1beta1.GetBlockWithTxsResponse: - type: object - properties: - txs: - type: array - items: - type: object - $ref: '#/definitions/cosmos.tx.v1beta1.Tx' - description: txs are the transactions in the block. - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - block: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block - in the blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - data: - type: object - properties: - txs: - type: array - items: - type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. - - NOTE: not all txs here are valid. We're just agreeing on the - order first. - - This means that block.AppHash does not include these txs. - title: Data contains the set of transactions included in the block - evidence: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for - - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a validator - signed two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules - for processing a block in the - blockchain, - - including all blockchain data structures - and the rules of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: >- - commit from validators from the last - block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs - from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: >- - Header defines the structure of a block - header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a block - was committed by a set of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use - with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of - validators attempting to mislead a light client. - last_commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a set - of validators. - pagination: - description: pagination defines a pagination for 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: >- - GetBlockWithTxsResponse is the response type for the - Service.GetBlockWithTxs method. - - - Since: cosmos-sdk 0.45.2 - cosmos.tx.v1beta1.GetTxResponse: - type: object - properties: - tx: - $ref: '#/definitions/cosmos.tx.v1beta1.Tx' - description: tx is the queried transaction. - tx_response: - description: tx_response is the queried TxResponses. - type: object - properties: - height: - type: string - format: int64 - title: The block height - txhash: - type: string - description: The transaction hash. - codespace: - type: string - title: Namespace for the Code - code: - type: integer - format: int64 - description: Response code. - data: - type: string - description: Result bytes, if any. - raw_log: - type: string - description: |- - The output of the application's logger (raw string). May be - non-deterministic. - logs: - type: array - items: - type: object - properties: - msg_index: - type: integer - format: int64 - log: - type: string - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - description: >- - Attribute defines an attribute wrapper where the key - and value are - - strings instead of raw bytes. - description: >- - StringEvent defines en Event object wrapper where all the - attributes - - contain key/value pairs that are strings instead of raw - bytes. - description: >- - Events contains a slice of Event objects that were emitted - during some - - execution. - description: >- - ABCIMessageLog defines a structure containing an indexed tx ABCI - message log. - description: >- - The output of the application's logger (typed). May be - non-deterministic. - info: - type: string - description: Additional information. May be non-deterministic. - gas_wanted: - type: string - format: int64 - description: Amount of gas requested for transaction. - gas_used: - type: string - format: int64 - description: Amount of gas consumed by transaction. - tx: - description: The request transaction bytes. - type: object - properties: - '@type': - 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. - additionalProperties: {} - timestamp: - type: string - description: >- - Time of the previous block. For heights > 1, it's the weighted - median of - - the timestamps of the valid votes in the block.LastCommit. For - height == 1, - - it's genesis time. - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - index: - type: boolean - title: nondeterministic - description: >- - EventAttribute is a single key-value pair, associated with - an event. - description: >- - Event allows application developers to attach additional - information to - - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and - ResponseDeliverTx. - - Later, transactions may be queried using these events. - description: >- - Events defines all the events emitted by processing a transaction. - Note, - - these events include those emitted by processing all the messages - and those - - emitted from the ante. Whereas Logs contains the events, with - - additional metadata, emitted only by processing the messages. - - - Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - description: GetTxResponse is the response type for the Service.GetTx method. - cosmos.tx.v1beta1.GetTxsEventResponse: - type: object - properties: - txs: - type: array - items: - type: object - $ref: '#/definitions/cosmos.tx.v1beta1.Tx' - description: txs is the list of queried transactions. - tx_responses: - type: array - items: - type: object - properties: - height: - type: string - format: int64 - title: The block height - txhash: - type: string - description: The transaction hash. - codespace: - type: string - title: Namespace for the Code - code: - type: integer - format: int64 - description: Response code. - data: - type: string - description: Result bytes, if any. - raw_log: - type: string - description: |- - The output of the application's logger (raw string). May be - non-deterministic. - logs: - type: array - items: - type: object - properties: - msg_index: - type: integer - format: int64 - log: - type: string - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - description: >- - Attribute defines an attribute wrapper where the - key and value are - - strings instead of raw bytes. - description: >- - StringEvent defines en Event object wrapper where all - the attributes - - contain key/value pairs that are strings instead of raw - bytes. - description: >- - Events contains a slice of Event objects that were emitted - during some - - execution. - description: >- - ABCIMessageLog defines a structure containing an indexed tx - ABCI message log. - description: >- - The output of the application's logger (typed). May be - non-deterministic. - info: - type: string - description: Additional information. May be non-deterministic. - gas_wanted: - type: string - format: int64 - description: Amount of gas requested for transaction. - gas_used: - type: string - format: int64 - description: Amount of gas consumed by transaction. - tx: - description: The request transaction bytes. - type: object - properties: - '@type': - 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. - additionalProperties: {} - timestamp: - type: string - description: >- - Time of the previous block. For heights > 1, it's the weighted - median of - - the timestamps of the valid votes in the block.LastCommit. For - height == 1, - - it's genesis time. - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - index: - type: boolean - title: nondeterministic - description: >- - EventAttribute is a single key-value pair, associated - with an event. - description: >- - Event allows application developers to attach additional - information to - - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and - ResponseDeliverTx. - - Later, transactions may be queried using these events. - description: >- - Events defines all the events emitted by processing a - transaction. Note, - - these events include those emitted by processing all the - messages and those - - emitted from the ante. Whereas Logs contains the events, with - - additional metadata, emitted only by processing the messages. - - - Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - description: >- - TxResponse defines a structure containing relevant tx data and - metadata. The - - tags are stringified and the log is JSON decoded. - description: tx_responses is the list of queried TxResponses. - pagination: - description: |- - pagination defines a pagination for the response. - Deprecated post v0.46.x: use total instead. - 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 - total: - type: string - format: uint64 - title: total is total number of results available - description: |- - GetTxsEventResponse is the response type for the Service.TxsByEvents - RPC method. - cosmos.tx.v1beta1.ModeInfo: - type: object - properties: - single: - title: single represents a single signer - type: object - properties: - mode: - title: mode is the signing mode of the single signer - type: string - enum: - - SIGN_MODE_UNSPECIFIED - - SIGN_MODE_DIRECT - - SIGN_MODE_TEXTUAL - - SIGN_MODE_DIRECT_AUX - - SIGN_MODE_LEGACY_AMINO_JSON - - SIGN_MODE_EIP_191 - default: SIGN_MODE_UNSPECIFIED - description: >- - SignMode represents a signing mode with its own security - guarantees. - - - This enum should be considered a registry of all known sign modes - - in the Cosmos ecosystem. Apps are not expected to support all - known - - sign modes. Apps that would like to support custom sign modes are - - encouraged to open a small PR against this file to add a new case - - to this SignMode enum describing their sign mode so that different - - apps have a consistent version of this enum. - - - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - rejected. - - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - 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 not supported. - - 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. - - - Since: cosmos-sdk 0.46 - - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - Amino JSON and will be removed in the future. - - SIGN_MODE_EIP_191: SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos - SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 - - - Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum - variant, - - but is not implemented on the SDK by default. To enable EIP-191, - you need - - to pass a custom `TxConfig` that has an implementation of - - `SignModeHandler` for EIP-191. The SDK may decide to fully support - - EIP-191 in the future. - - - Since: cosmos-sdk 0.45.2 - multi: - $ref: '#/definitions/cosmos.tx.v1beta1.ModeInfo.Multi' - title: multi represents a nested multisig signer - description: ModeInfo describes the signing mode of a single or nested multisig signer. - cosmos.tx.v1beta1.ModeInfo.Multi: - type: object - properties: - bitarray: - title: bitarray specifies which keys within the multisig are signing - type: object - properties: - extra_bits_stored: - type: integer - format: int64 - elems: - type: string - format: byte - description: >- - CompactBitArray is an implementation of a space efficient bit array. - - This is used to ensure that the encoded data takes up a minimal amount - of - - space after proto encoding. - - This is not thread safe, and is not intended for concurrent usage. - mode_infos: - type: array - items: - type: object - $ref: '#/definitions/cosmos.tx.v1beta1.ModeInfo' - title: |- - mode_infos is the corresponding modes of the signers of the multisig - which could include nested multisig public keys - title: Multi is the mode info for a multisig public key - cosmos.tx.v1beta1.ModeInfo.Single: - type: object - properties: - mode: - title: mode is the signing mode of the single signer - type: string - enum: - - SIGN_MODE_UNSPECIFIED - - SIGN_MODE_DIRECT - - SIGN_MODE_TEXTUAL - - SIGN_MODE_DIRECT_AUX - - SIGN_MODE_LEGACY_AMINO_JSON - - SIGN_MODE_EIP_191 - default: SIGN_MODE_UNSPECIFIED - description: >- - SignMode represents a signing mode with its own security guarantees. - - - This enum should be considered a registry of all known sign modes - - in the Cosmos ecosystem. Apps are not expected to support all known - - sign modes. Apps that would like to support custom sign modes are - - encouraged to open a small PR against this file to add a new case - - to this SignMode enum describing their sign mode so that different - - apps have a consistent version of this enum. - - - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - rejected. - - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - 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 not supported. - - 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. - - - Since: cosmos-sdk 0.46 - - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - Amino JSON and will be removed in the future. - - SIGN_MODE_EIP_191: SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos - SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 - - - Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, - - but is not implemented on the SDK by default. To enable EIP-191, you - need - - to pass a custom `TxConfig` that has an implementation of - - `SignModeHandler` for EIP-191. The SDK may decide to fully support - - EIP-191 in the future. - - - Since: cosmos-sdk 0.45.2 - title: |- - Single is the mode info for a single signer. It is structured as a message - to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the - future - cosmos.tx.v1beta1.OrderBy: - type: string - enum: - - ORDER_BY_UNSPECIFIED - - ORDER_BY_ASC - - ORDER_BY_DESC - default: ORDER_BY_UNSPECIFIED - description: >- - - ORDER_BY_UNSPECIFIED: ORDER_BY_UNSPECIFIED specifies an unknown sorting - order. OrderBy defaults to ASC in this case. - - ORDER_BY_ASC: ORDER_BY_ASC defines ascending order - - ORDER_BY_DESC: ORDER_BY_DESC defines descending order - title: OrderBy defines the sorting order - cosmos.tx.v1beta1.SignerInfo: - type: object - properties: - public_key: - description: >- - public_key is the public key of the signer. It is optional for - accounts - - that already exist in state. If unset, the verifier can use the - required \ - - signer address for this position and lookup the public key. - type: object - properties: - '@type': - 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. - additionalProperties: {} - mode_info: - $ref: '#/definitions/cosmos.tx.v1beta1.ModeInfo' - title: |- - mode_info describes the signing mode of the signer and is a nested - structure to support nested multisig pubkey's - sequence: - type: string - format: uint64 - description: >- - sequence is the sequence of the account, which describes the - - number of committed transactions signed by a given address. It is used - to - - prevent replay attacks. - description: |- - SignerInfo describes the public key and signing mode of a single top-level - signer. - cosmos.tx.v1beta1.SimulateRequest: - type: object - properties: - tx: - $ref: '#/definitions/cosmos.tx.v1beta1.Tx' - description: |- - tx is the transaction to simulate. - Deprecated. Send raw tx bytes instead. - tx_bytes: - type: string - format: byte - description: |- - tx_bytes is the raw transaction. - - Since: cosmos-sdk 0.43 - description: |- - SimulateRequest is the request type for the Service.Simulate - RPC method. - cosmos.tx.v1beta1.SimulateResponse: - type: object - properties: - gas_info: - description: gas_info is the information about gas used in the simulation. - type: object - properties: - gas_wanted: - type: string - format: uint64 - description: >- - GasWanted is the maximum units of work we allow this tx to - perform. - gas_used: - type: string - format: uint64 - description: GasUsed is the amount of gas actually consumed. - result: - description: result is the result of the simulation. - type: object - properties: - data: - type: string - format: byte - description: >- - Data is any data returned from message or handler execution. It - MUST be - - length prefixed in order to separate data from multiple message - executions. - - Deprecated. This field is still populated, but prefer msg_response - instead - - because it also contains the Msg response typeURL. - log: - type: string - description: >- - Log contains the log information from message or handler - execution. - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - index: - type: boolean - title: nondeterministic - description: >- - EventAttribute is a single key-value pair, associated with - an event. - description: >- - Event allows application developers to attach additional - information to - - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and - ResponseDeliverTx. - - Later, transactions may be queried using these events. - description: >- - Events contains a slice of Event objects that were emitted during - message - - or handler execution. - msg_responses: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - msg_responses contains the Msg handler responses type packed in - Anys. - - - Since: cosmos-sdk 0.46 - description: |- - SimulateResponse is the response type for the - Service.SimulateRPC method. - cosmos.tx.v1beta1.Tip: - type: object - properties: - amount: - type: array - items: - 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. - title: amount is the amount of the tip - tipper: - type: string - title: tipper is the address of the account paying for the tip - description: |- - Tip is the tip used for meta-transactions. - - Since: cosmos-sdk 0.46 - cosmos.tx.v1beta1.Tx: - type: object - properties: - body: - title: body is the processable content of the transaction - type: object - properties: - messages: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - messages is a list of messages to be executed. The required - signers of - - those messages define the number and order of elements in - AuthInfo's - - signer_infos and Tx's signatures. Each required signer address is - added to - - the list only the first time it occurs. - - By convention, the first required signer (usually from the first - message) - - is referred to as the primary signer and pays the fee for the - whole - - transaction. - memo: - type: string - description: >- - 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). - timeout_height: - type: string - format: uint64 - title: |- - timeout is the block height after which this transaction will not - be processed by the chain - extension_options: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: >- - 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 - non_critical_extension_options: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: >- - 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, they will be ignored - description: TxBody is the body of a transaction that all signers sign over. - auth_info: - $ref: '#/definitions/cosmos.tx.v1beta1.AuthInfo' - title: |- - auth_info is the authorization related content of the transaction, - specifically signers, signer modes and fee - signatures: - type: array - items: - type: string - format: byte - description: >- - signatures is a list of signatures that matches the length and order - of - - AuthInfo's signer_infos to allow connecting signature meta information - like - - public key and signing mode by position. - description: Tx is the standard type used for broadcasting transactions. - cosmos.tx.v1beta1.TxBody: - type: object - properties: - messages: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - messages is a list of messages to be executed. The required signers of - - those messages define the number and order of elements in AuthInfo's - - signer_infos and Tx's signatures. Each required signer address is - added to - - the list only the first time it occurs. - - By convention, the first required signer (usually from the first - message) - - is referred to as the primary signer and pays the fee for the whole - - transaction. - memo: - type: string - description: >- - 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). - timeout_height: - type: string - format: uint64 - title: |- - timeout is the block height after which this transaction will not - be processed by the chain - extension_options: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: >- - 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 - non_critical_extension_options: - type: array - items: - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: >- - 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, they will be ignored - description: TxBody is the body of a transaction that all signers sign over. - cosmos.tx.v1beta1.TxDecodeAminoRequest: - type: object - properties: - amino_binary: - type: string - format: byte - description: |- - TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino - RPC method. - - Since: cosmos-sdk 0.47 - cosmos.tx.v1beta1.TxDecodeAminoResponse: - type: object - properties: - amino_json: - type: string - description: |- - TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino - RPC method. - - Since: cosmos-sdk 0.47 - cosmos.tx.v1beta1.TxDecodeRequest: - type: object - properties: - tx_bytes: - type: string - format: byte - description: tx_bytes is the raw transaction. - description: |- - TxDecodeRequest is the request type for the Service.TxDecode - RPC method. - - Since: cosmos-sdk 0.47 - cosmos.tx.v1beta1.TxDecodeResponse: - type: object - properties: - tx: - $ref: '#/definitions/cosmos.tx.v1beta1.Tx' - description: tx is the decoded transaction. - description: |- - TxDecodeResponse is the response type for the - Service.TxDecode method. - - Since: cosmos-sdk 0.47 - cosmos.tx.v1beta1.TxEncodeAminoRequest: - type: object - properties: - amino_json: - type: string - description: |- - TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino - RPC method. - - Since: cosmos-sdk 0.47 - cosmos.tx.v1beta1.TxEncodeAminoResponse: - type: object - properties: - amino_binary: - type: string - format: byte - description: |- - TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino - RPC method. - - Since: cosmos-sdk 0.47 - cosmos.tx.v1beta1.TxEncodeRequest: - type: object - properties: - tx: - $ref: '#/definitions/cosmos.tx.v1beta1.Tx' - description: tx is the transaction to encode. - description: |- - TxEncodeRequest is the request type for the Service.TxEncode - RPC method. - - Since: cosmos-sdk 0.47 - cosmos.tx.v1beta1.TxEncodeResponse: - type: object - properties: - tx_bytes: - type: string - format: byte - description: tx_bytes is the encoded transaction bytes. - description: |- - TxEncodeResponse is the response type for the - Service.TxEncode method. - - Since: cosmos-sdk 0.47 - tendermint.abci.Event: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - index: - type: boolean - title: nondeterministic - description: EventAttribute is a single key-value pair, associated with an event. - description: >- - Event allows application developers to attach additional information to - - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and - ResponseDeliverTx. - - Later, transactions may be queried using these events. - tendermint.abci.EventAttribute: - type: object - properties: - key: - type: string - value: - type: string - index: - type: boolean - title: nondeterministic - description: EventAttribute is a single key-value pair, associated with an event. - cosmos.upgrade.v1beta1.ModuleVersion: - type: object - properties: - name: - type: string - title: name of the app module - version: - type: string - format: uint64 - title: consensus version of the app module - description: |- - ModuleVersion specifies a module and its consensus version. - - Since: cosmos-sdk 0.43 - cosmos.upgrade.v1beta1.Plan: - type: object - properties: - name: - type: string - description: >- - Sets the name for the upgrade. This name will be used by the upgraded - - version of the software to apply any special "on-upgrade" commands - during - - the first BeginBlock method after the upgrade is applied. It is also - used - - to detect whether a software version can handle a given upgrade. If no - - upgrade handler with this name has been set in the software, it will - be - - assumed that the software is out-of-date when the upgrade Time or - Height is - - reached and the software will exit. - time: - type: string - format: date-time - description: >- - Deprecated: Time based upgrades have been deprecated. Time based - upgrade logic - - has been removed from the SDK. - - If this field is not empty, an error will be thrown. - height: - type: string - format: int64 - description: The height at which the upgrade must be performed. - info: - type: string - title: |- - Any application specific upgrade info to be included on-chain - such as a git commit that validators could automatically upgrade to - upgraded_client_state: - description: >- - Deprecated: UpgradedClientState field has been deprecated. IBC upgrade - logic has been - - moved to the IBC module in the sub module 02-client. - - If this field is not empty, an error will be thrown. - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - Plan specifies information about a planned upgrade and when it should - occur. - cosmos.upgrade.v1beta1.QueryAppliedPlanResponse: - type: object - properties: - height: - type: string - format: int64 - description: height is the block height at which the plan was applied. - description: >- - QueryAppliedPlanResponse is the response type for the Query/AppliedPlan - RPC - - method. - cosmos.upgrade.v1beta1.QueryAuthorityResponse: - type: object - properties: - address: - type: string - description: 'Since: cosmos-sdk 0.46' - title: QueryAuthorityResponse is the response type for Query/Authority - cosmos.upgrade.v1beta1.QueryCurrentPlanResponse: - type: object - properties: - plan: - description: plan is the current upgrade plan. - type: object - properties: - name: - type: string - description: >- - Sets the name for the upgrade. This name will be used by the - upgraded - - version of the software to apply any special "on-upgrade" commands - during - - the first BeginBlock method after the upgrade is applied. It is - also used - - to detect whether a software version can handle a given upgrade. - If no - - upgrade handler with this name has been set in the software, it - will be - - assumed that the software is out-of-date when the upgrade Time or - Height is - - reached and the software will exit. - time: - type: string - format: date-time - description: >- - Deprecated: Time based upgrades have been deprecated. Time based - upgrade logic - - has been removed from the SDK. - - If this field is not empty, an error will be thrown. - height: - type: string - format: int64 - description: The height at which the upgrade must be performed. - info: - type: string - title: >- - Any application specific upgrade info to be included on-chain - - such as a git commit that validators could automatically upgrade - to - upgraded_client_state: - description: >- - Deprecated: UpgradedClientState field has been deprecated. IBC - upgrade logic has been - - moved to the IBC module in the sub module 02-client. - - If this field is not empty, an error will be thrown. - type: object - properties: - '@type': - 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. - additionalProperties: {} - description: >- - QueryCurrentPlanResponse is the response type for the Query/CurrentPlan - RPC - - method. - cosmos.upgrade.v1beta1.QueryModuleVersionsResponse: - type: object - properties: - module_versions: - type: array - items: - type: object - properties: - name: - type: string - title: name of the app module - version: - type: string - format: uint64 - title: consensus version of the app module - description: |- - ModuleVersion specifies a module and its consensus version. - - Since: cosmos-sdk 0.43 - description: >- - module_versions is a list of module names with their consensus - versions. - description: >- - QueryModuleVersionsResponse is the response type for the - Query/ModuleVersions - - RPC method. - - - Since: cosmos-sdk 0.43 - cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse: - type: object - properties: - upgraded_consensus_state: - type: string - format: byte - title: 'Since: cosmos-sdk 0.43' - description: >- - QueryUpgradedConsensusStateResponse is the response type for the - Query/UpgradedConsensusState - - RPC method. - cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse: - type: object - description: |- - MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. - - Since: cosmos-sdk 0.46 - cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse: - type: object - description: |- - MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. - - Since: cosmos-sdk 0.46 - cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse: - type: object - description: >- - MsgCreateVestingAccountResponse defines the - Msg/CreatePeriodicVestingAccount - - response type. - - - Since: cosmos-sdk 0.46 - cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse: - type: object - description: >- - MsgCreatePermanentLockedAccountResponse defines the - Msg/CreatePermanentLockedAccount response type. - - - Since: cosmos-sdk 0.46 - cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse: - type: object - description: >- - MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount - response type. - cosmos.vesting.v1beta1.Period: - type: object - properties: - length: - type: string - format: int64 - description: Period duration in seconds. - amount: - type: array - items: - 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: Period defines a length of time and amount of coins that will vest. - fundraising.AllowedBidder: - type: object - properties: - bidder: - type: string - title: bidder specifies the bech32-encoded address that bids for the auction - max_bid_amount: - type: string - title: >- - max_bid_amount specifies the maximum bid amount that the bidder can - bid - description: AllowedBidder defines an allowed bidder for the auction. - fundraising.Bid: - type: object - properties: - auction_id: - type: string - format: uint64 - title: auction_id specifies the id of the auction - bidder: - type: string - title: bidder specifies the bech32-encoded address that bids for the auction - id: - type: string - format: uint64 - title: id specifies an index of a bid for the bidder - type: - title: >- - type specifies the bid type; type 1 is fixed price, 2 is - how-much-worth, 3 - - is how-many-coins - type: string - enum: - - BID_TYPE_UNSPECIFIED - - BID_TYPE_FIXED_PRICE - - BID_TYPE_BATCH_WORTH - - BID_TYPE_BATCH_MANY - default: BID_TYPE_UNSPECIFIED - description: |- - BidType enumerates the valid types of a bid. - - - BID_TYPE_UNSPECIFIED: BID_TYPE_UNSPECIFIED defines the default bid type - - BID_TYPE_FIXED_PRICE: BID_TYPE_FIXED_PRICE defines a bid type for a fixed price auction type - - BID_TYPE_BATCH_WORTH: BID_TYPE_BATCH_WORTH defines a bid type for How-Much-Worth-to-Buy of a - batch auction - - BID_TYPE_BATCH_MANY: BID_TYPE_BATCH_MANY defines a bid type for How-Many-Coins-to-Buy of a batch - auction - price: - type: string - title: price specifies the bid price in which price the bidder places the bid - coin: - description: >- - coin specifies the amount of coin that the bidder bids - - for a fixed price auction, the denom is of the paying coin. - - for a batch auction of how-much-worth, the denom is of the paying - coin. - - for a batch auction of how-many-coins, the denom is of the selling - coin. - type: object - properties: - denom: - type: string - amount: - type: string - is_matched: - type: boolean - title: >- - is_matched specifies the bid that is a winning bid and enables the - bidder - - to purchase the selling coin - description: Bid defines a standard bid for an auction. - fundraising.BidType: - type: string - enum: - - BID_TYPE_UNSPECIFIED - - BID_TYPE_FIXED_PRICE - - BID_TYPE_BATCH_WORTH - - BID_TYPE_BATCH_MANY - default: BID_TYPE_UNSPECIFIED - description: |- - BidType enumerates the valid types of a bid. - - - BID_TYPE_UNSPECIFIED: BID_TYPE_UNSPECIFIED defines the default bid type - - BID_TYPE_FIXED_PRICE: BID_TYPE_FIXED_PRICE defines a bid type for a fixed price auction type - - BID_TYPE_BATCH_WORTH: BID_TYPE_BATCH_WORTH defines a bid type for How-Much-Worth-to-Buy of a - batch auction - - BID_TYPE_BATCH_MANY: BID_TYPE_BATCH_MANY defines a bid type for How-Many-Coins-to-Buy of a batch - auction - fundraising.Params: - type: object - properties: - auction_creation_fee: - type: array - items: - 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. - title: >- - auction_creation_fee specifies the fee for auction creation. - - this prevents from spamming attack and it is collected in the - community - - pool - place_bid_fee: - type: array - items: - 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. - title: >- - place_bid_fee specifies the fee for placing a bid for an auction. - - this prevents from spamming attack and it is collected in the - community - - pool - extended_period: - type: integer - format: int64 - title: |- - extended_period specifies the extended period that determines how long - the extended auction round lasts - description: Params defines the set of params for the fundraising module. - fundraising.QueryAllowedBidderResponse: - type: object - properties: - allowed_bidder: - type: object - properties: - bidder: - type: string - title: >- - bidder specifies the bech32-encoded address that bids for the - auction - max_bid_amount: - type: string - title: >- - max_bid_amount specifies the maximum bid amount that the bidder - can bid - description: AllowedBidder defines an allowed bidder for the auction. - description: >- - QueryAllowedBidderResponse is the response type for the - Query/AllowedBidder - - RPC method. - fundraising.QueryAllowedBiddersResponse: - type: object - properties: - allowed_bidders: - type: array - items: - type: object - properties: - bidder: - type: string - title: >- - bidder specifies the bech32-encoded address that bids for the - auction - max_bid_amount: - type: string - title: >- - max_bid_amount specifies the maximum bid amount that the bidder - can bid - description: AllowedBidder defines an allowed bidder for the auction. - pagination: - title: 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: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - description: >- - QueryAllowedBiddersResponse is the response type for the - Query/AllowedBidders - - RPC method. - fundraising.QueryAuctionResponse: - type: object - properties: - auction: - type: object - properties: - '@type': - 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. As of May 2023, there are no widely used type - server - - implementations and no plans to implement one. - - - Schemes other than `http`, `https` (or the empty scheme) might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - QueryAuctionResponse is the response type for the Query/Auction RPC - method. - fundraising.QueryAuctionsResponse: - type: object - properties: - auctions: - type: array - items: - type: object - properties: - '@type': - 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. As of May 2023, there are no widely used - type server - - implementations and no plans to implement one. - - - Schemes other than `http`, `https` (or the empty scheme) might - be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: auctions specifies the existing auctions - pagination: - title: 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: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - description: QueryAuctionsResponse is response type for the Query/Auctions RPC method. - fundraising.QueryBidResponse: - type: object - properties: - bid: - title: bid specifies specific bid - type: object - properties: - auction_id: - type: string - format: uint64 - title: auction_id specifies the id of the auction - bidder: - type: string - title: >- - bidder specifies the bech32-encoded address that bids for the - auction - id: - type: string - format: uint64 - title: id specifies an index of a bid for the bidder - type: - title: >- - type specifies the bid type; type 1 is fixed price, 2 is - how-much-worth, 3 - - is how-many-coins - type: string - enum: - - BID_TYPE_UNSPECIFIED - - BID_TYPE_FIXED_PRICE - - BID_TYPE_BATCH_WORTH - - BID_TYPE_BATCH_MANY - default: BID_TYPE_UNSPECIFIED - description: |- - BidType enumerates the valid types of a bid. - - - BID_TYPE_UNSPECIFIED: BID_TYPE_UNSPECIFIED defines the default bid type - - BID_TYPE_FIXED_PRICE: BID_TYPE_FIXED_PRICE defines a bid type for a fixed price auction type - - BID_TYPE_BATCH_WORTH: BID_TYPE_BATCH_WORTH defines a bid type for How-Much-Worth-to-Buy of a - batch auction - - BID_TYPE_BATCH_MANY: BID_TYPE_BATCH_MANY defines a bid type for How-Many-Coins-to-Buy of a batch - auction - price: - type: string - title: >- - price specifies the bid price in which price the bidder places the - bid - coin: - description: >- - coin specifies the amount of coin that the bidder bids - - for a fixed price auction, the denom is of the paying coin. - - for a batch auction of how-much-worth, the denom is of the paying - coin. - - for a batch auction of how-many-coins, the denom is of the selling - coin. - type: object - properties: - denom: - type: string - amount: - type: string - is_matched: - type: boolean - title: >- - is_matched specifies the bid that is a winning bid and enables the - bidder - - to purchase the selling coin - description: Bid defines a standard bid for an auction. - description: QueryBidResponse is response type for the Query/Sequence RPC method. - fundraising.QueryBidsResponse: - type: object - properties: - bids: - type: array - items: - type: object - properties: - auction_id: - type: string - format: uint64 - title: auction_id specifies the id of the auction - bidder: - type: string - title: >- - bidder specifies the bech32-encoded address that bids for the - auction - id: - type: string - format: uint64 - title: id specifies an index of a bid for the bidder - type: - title: >- - type specifies the bid type; type 1 is fixed price, 2 is - how-much-worth, 3 - - is how-many-coins - type: string - enum: - - BID_TYPE_UNSPECIFIED - - BID_TYPE_FIXED_PRICE - - BID_TYPE_BATCH_WORTH - - BID_TYPE_BATCH_MANY - default: BID_TYPE_UNSPECIFIED - description: |- - BidType enumerates the valid types of a bid. - - - BID_TYPE_UNSPECIFIED: BID_TYPE_UNSPECIFIED defines the default bid type - - BID_TYPE_FIXED_PRICE: BID_TYPE_FIXED_PRICE defines a bid type for a fixed price auction type - - BID_TYPE_BATCH_WORTH: BID_TYPE_BATCH_WORTH defines a bid type for How-Much-Worth-to-Buy of a - batch auction - - BID_TYPE_BATCH_MANY: BID_TYPE_BATCH_MANY defines a bid type for How-Many-Coins-to-Buy of a batch - auction - price: - type: string - title: >- - price specifies the bid price in which price the bidder places - the bid - coin: - description: >- - coin specifies the amount of coin that the bidder bids - - for a fixed price auction, the denom is of the paying coin. - - for a batch auction of how-much-worth, the denom is of the - paying coin. - - for a batch auction of how-many-coins, the denom is of the - selling coin. - type: object - properties: - denom: - type: string - amount: - type: string - is_matched: - type: boolean - title: >- - is_matched specifies the bid that is a winning bid and enables - the bidder - - to purchase the selling coin - description: Bid defines a standard bid for an auction. - title: bids specifies the existing bids - pagination: - title: 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: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - description: QueryBidsResponse is response type for the Query/Bids RPC method. - fundraising.QueryParamsResponse: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - properties: - auction_creation_fee: - type: array - items: - 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. - title: >- - auction_creation_fee specifies the fee for auction creation. - - this prevents from spamming attack and it is collected in the - community - - pool - place_bid_fee: - type: array - items: - 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. - title: >- - place_bid_fee specifies the fee for placing a bid for an auction. - - this prevents from spamming attack and it is collected in the - community - - pool - extended_period: - type: integer - format: int64 - title: >- - extended_period specifies the extended period that determines how - long - - the extended auction round lasts - description: QueryParamsResponse is response type for the Query/Params RPC method. - fundraising.QueryVestingsResponse: - type: object - properties: - vestings: - type: array - items: - type: object - properties: - auction_id: - type: string - format: uint64 - title: auction_id specifies the id of the auction - auctioneer: - type: string - title: >- - auctioneer specifies the bech32-encoded address that creates the - auction - paying_coin: - title: paying_coin specifies the paying amount of coin - 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. - release_time: - type: string - format: date-time - title: release_time specifies the timestamp of the vesting schedule - released: - type: boolean - title: released specifies the status of distribution - description: VestingQueue defines the vesting queue. - title: vestings specifies the existing vestings - description: QueryVestingsResponse is response type for the Query/Vestings RPC method. - fundraising.VestingQueue: - type: object - properties: - auction_id: - type: string - format: uint64 - title: auction_id specifies the id of the auction - auctioneer: - type: string - title: >- - auctioneer specifies the bech32-encoded address that creates the - auction - paying_coin: - title: paying_coin specifies the paying amount of coin - 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. - release_time: - type: string - format: date-time - title: release_time specifies the timestamp of the vesting schedule - released: - type: boolean - title: released specifies the status of distribution - description: VestingQueue defines the vesting queue. - fundraising.MsgAddAllowedBidderResponse: - type: object - fundraising.MsgCancelAuctionResponse: - type: object - description: |- - MsgCancelAuctionResponse defines the Msg/MsgCancelAuctionResponse - response type. - fundraising.MsgCreateBatchAuctionResponse: - type: object - description: |- - MsgCreateBatchAuctionResponse defines the - Msg/MsgCreateBatchAuctionResponse response type. - fundraising.MsgCreateFixedPriceAuctionResponse: - type: object - description: |- - MsgCreateFixedPriceAuctionResponse defines the - Msg/MsgCreateFixedPriceAuctionResponse response type. - fundraising.MsgModifyBidResponse: - type: object - description: MsgModifyBidResponse defines the Msg/MsgModifyBidResponse response type. - fundraising.MsgPlaceBidResponse: - type: object - description: MsgPlaceBidResponse defines the Msg/MsgPlaceBidResponse response type. - fundraising.VestingSchedule: - type: object - properties: - release_time: - type: string - format: date-time - title: release_time specifies the time for distribution of the vesting coin - weight: - type: string - title: weight specifies the vesting weight for the schedule - description: VestingSchedule defines the vesting schedule for the owner of an auction. diff --git a/cmd/encoding.go b/cmd/encoding.go deleted file mode 100644 index 91124d63..00000000 --- a/cmd/encoding.go +++ /dev/null @@ -1,44 +0,0 @@ -package cmd - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/std" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/x/auth/tx" -) - -// EncodingConfig specifies the concrete encoding types to use for a given app. -// This is provided for compatibility between protobuf and amino implementations. -type EncodingConfig struct { - InterfaceRegistry types.InterfaceRegistry - Marshaler codec.Codec - TxConfig client.TxConfig - Amino *codec.LegacyAmino -} - -// makeEncodingConfig creates an EncodingConfig for an amino based test configuration. -func makeEncodingConfig() EncodingConfig { - amino := codec.NewLegacyAmino() - interfaceRegistry := types.NewInterfaceRegistry() - marshaler := codec.NewProtoCodec(interfaceRegistry) - txCfg := tx.NewTxConfig(marshaler, tx.DefaultSignModes) - - return EncodingConfig{ - InterfaceRegistry: interfaceRegistry, - Marshaler: marshaler, - TxConfig: txCfg, - Amino: amino, - } -} - -// MakeEncodingConfig creates an EncodingConfig for testing -func MakeEncodingConfig(moduleBasics module.BasicManager) EncodingConfig { - encodingConfig := makeEncodingConfig() - std.RegisterLegacyAminoCodec(encodingConfig.Amino) - std.RegisterInterfaces(encodingConfig.InterfaceRegistry) - moduleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino) - moduleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry) - return encodingConfig -} diff --git a/cmd/fundraisingd/cmd/commands.go b/cmd/fundraisingd/cmd/commands.go new file mode 100644 index 00000000..4e6530fc --- /dev/null +++ b/cmd/fundraisingd/cmd/commands.go @@ -0,0 +1,187 @@ +package cmd + +import ( + "errors" + "io" + + "cosmossdk.io/log" + confixcmd "cosmossdk.io/tools/confix/cmd" + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/client" + "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/server" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + "github.com/cosmos/cosmos-sdk/types/module" + authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" + "github.com/cosmos/cosmos-sdk/x/crisis" + genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" + "github.com/spf13/cobra" + "github.com/spf13/viper" + + "github.com/tendermint/fundraising/app" +) + +func initRootCmd( + rootCmd *cobra.Command, + txConfig client.TxConfig, + basicManager module.BasicManager, +) { + rootCmd.AddCommand( + genutilcli.InitCmd(basicManager, app.DefaultNodeHome), + debug.Cmd(), + confixcmd.ConfigCommand(), + pruning.Cmd(newApp, app.DefaultNodeHome), + snapshot.Cmd(newApp), + ) + + server.AddCommands(rootCmd, app.DefaultNodeHome, newApp, appExport, addModuleInitFlags) + + // add keybase, auxiliary RPC, query, genesis, and tx child commands + rootCmd.AddCommand( + server.StatusCommand(), + genesisCommand(txConfig, basicManager), + queryCommand(), + txCommand(), + keys.Commands(), + ) +} + +func addModuleInitFlags(startCmd *cobra.Command) { + crisis.AddModuleInitFlags(startCmd) +} + +// genesisCommand builds genesis-related `fundraisingd genesis` command. Users may provide application specific commands as a parameter +func genesisCommand(txConfig client.TxConfig, basicManager module.BasicManager, cmds ...*cobra.Command) *cobra.Command { + cmd := genutilcli.Commands(txConfig, basicManager, app.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.QueryEventForTxCmd(), + rpc.ValidatorCommand(), + server.QueryBlockCmd(), + authcmd.QueryTxsByEventsCmd(), + server.QueryBlocksCmd(), + authcmd.QueryTxCmd(), + server.QueryBlockResultsCmd(), + ) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + + 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(), + flags.LineBreak, + authcmd.GetBroadcastCommand(), + authcmd.GetEncodeCommand(), + authcmd.GetDecodeCommand(), + authcmd.GetSimulateCmd(), + ) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + + 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) + + app, err := app.New( + logger, db, traceStore, true, + appOpts, + baseappOptions..., + ) + if err != nil { + panic(err) + } + return app +} + +// appExport creates a new app (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 ( + bApp *app.App + err 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") + } + + // overwrite the FlagInvCheckPeriod + viperAppOpts.Set(server.FlagInvCheckPeriod, 1) + appOpts = viperAppOpts + + if height != -1 { + bApp, err = app.New(logger, db, traceStore, false, appOpts) + if err != nil { + return servertypes.ExportedApp{}, err + } + + if err := bApp.LoadHeight(height); err != nil { + return servertypes.ExportedApp{}, err + } + } else { + bApp, err = app.New(logger, db, traceStore, true, appOpts) + if err != nil { + return servertypes.ExportedApp{}, err + } + } + + return bApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) +} diff --git a/cmd/fundraisingd/cmd/config.go b/cmd/fundraisingd/cmd/config.go new file mode 100644 index 00000000..a14ebc57 --- /dev/null +++ b/cmd/fundraisingd/cmd/config.go @@ -0,0 +1,62 @@ +package cmd + +import ( + cmtcfg "github.com/cometbft/cometbft/config" + serverconfig "github.com/cosmos/cosmos-sdk/server/config" +) + +// 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. + type CustomAppConfig struct { + serverconfig.Config `mapstructure:",squash"` + } + + // 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 tests, we set the min gas prices to 0. + // srvCfg.MinGasPrices = "0stake" + // srvCfg.BaseConfig.IAVLDisableFastNode = true // disable fastnode by default + + customAppConfig := CustomAppConfig{ + Config: *srvCfg, + } + + customAppTemplate := serverconfig.DefaultConfigTemplate + // Edit the default template file + // + // 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 +} diff --git a/cmd/fundraisingd/cmd/root.go b/cmd/fundraisingd/cmd/root.go new file mode 100644 index 00000000..31aee182 --- /dev/null +++ b/cmd/fundraisingd/cmd/root.go @@ -0,0 +1,147 @@ +package cmd + +import ( + "os" + "strings" + + "cosmossdk.io/client/v2/autocli" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "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" + "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" + "github.com/spf13/cobra" + "github.com/spf13/pflag" + + "github.com/tendermint/fundraising/app" +) + +// NewRootCmd creates a new root command for fundraisingd. 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(app.AppConfig(), + depinject.Supply( + log.NewNopLogger(), + ), + depinject.Provide( + ProvideClientContext, + ), + ), + &autoCliOpts, + &moduleBasicManager, + &clientCtx, + ); err != nil { + panic(err) + } + + rootCmd := &cobra.Command{ + Use: app.Name + "d", + Short: "Start fundraising node", + 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()) + 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) + }, + } + + // Since the IBC modules don't support dependency injection, we need to + // manually register the modules on the client side. + // This needs to be removed after IBC supports App Wiring. + ibcModules := app.RegisterIBC(clientCtx.InterfaceRegistry) + for name, mod := range ibcModules { + moduleBasicManager[name] = module.CoreAppModuleBasicAdaptor(name, mod) + autoCliOpts.Modules[name] = mod + } + + initRootCmd(rootCmd, clientCtx.TxConfig, moduleBasicManager) + + overwriteFlagDefaults(rootCmd, map[string]string{ + flags.FlagChainID: strings.ReplaceAll(app.Name, "-", ""), + flags.FlagKeyringBackend: "test", + }) + + if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil { + panic(err) + } + + return rootCmd +} + +func overwriteFlagDefaults(c *cobra.Command, defaults map[string]string) { + set := func(s *pflag.FlagSet, key, val string) { + if f := s.Lookup(key); f != nil { + f.DefValue = val + _ = f.Value.Set(val) + } + } + for key, val := range defaults { + set(c.Flags(), key, val) + set(c.PersistentFlags(), key, val) + } + for _, c := range c.Commands() { + overwriteFlagDefaults(c, defaults) + } +} + +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(app.DefaultNodeHome). + WithViper(app.Name) // env variable prefix + + // Read the config again to overwrite the default values with the values from the config file + 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/cmd/fundraisingd/main.go b/cmd/fundraisingd/main.go index 41ccb034..61aecd6e 100644 --- a/cmd/fundraisingd/main.go +++ b/cmd/fundraisingd/main.go @@ -1,26 +1,20 @@ package main -// DONTCOVER - import ( + "fmt" "os" + clienthelpers "cosmossdk.io/client/v2/helpers" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" "github.com/tendermint/fundraising/app" - "github.com/tendermint/fundraising/cmd" + "github.com/tendermint/fundraising/cmd/fundraisingd/cmd" ) func main() { - rootCmd, _ := cmd.NewRootCmd( - app.Name, - app.AccountAddressPrefix, - app.DefaultNodeHome, - app.DefaultChainID, - app.ModuleBasics, - app.New, - ) - if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { + rootCmd := cmd.NewRootCmd() + if err := svrcmd.Execute(rootCmd, clienthelpers.EnvPrefix, app.DefaultNodeHome); err != nil { + fmt.Fprintln(rootCmd.OutOrStderr(), err) os.Exit(1) } } diff --git a/cmd/genaccounts.go b/cmd/genaccounts.go deleted file mode 100644 index 369d3c50..00000000 --- a/cmd/genaccounts.go +++ /dev/null @@ -1,195 +0,0 @@ -package cmd - -// DONTCOVER - -import ( - "bufio" - "encoding/json" - "errors" - "fmt" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - "github.com/cosmos/cosmos-sdk/server" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - 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" -) - -const ( - flagVestingStart = "vesting-start-time" - flagVestingEnd = "vesting-end-time" - flagVestingAmt = "vesting-amount" -) - -// AddGenesisAccountCmd returns add-genesis-account cobra Command. -func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command { - cmd := &cobra.Command{ - Use: "add-genesis-account [address_or_key_name] [coin][,[coin]]", - Short: "Add a genesis account to genesis.json", - Long: `Add a genesis account to genesis.json. The provided account must specify -the account address or key name and a list of initial coins. If a key name is given, -the address will be looked up in the local Keybase. The list of initial tokens must -contain valid denominations. Accounts may optionally be supplied with vesting parameters. -`, - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - depCdc := clientCtx.Codec - cdc := depCdc - - serverCtx := server.GetServerContextFromCmd(cmd) - config := serverCtx.Config - - config.SetRoot(clientCtx.HomeDir) - - coins, err := sdk.ParseCoinsNormalized(args[1]) - if err != nil { - return fmt.Errorf("failed to parse coins: %w", err) - } - - addr, err := sdk.AccAddressFromBech32(args[0]) - if err != nil { - inBuf := bufio.NewReader(cmd.InOrStdin()) - keyringBackend, err := cmd.Flags().GetString(flags.FlagKeyringBackend) - if err != nil { - return err - } - - // attempt to lookup address from Keybase if no address was provided - kb, err := keyring.New(sdk.KeyringServiceName(), keyringBackend, clientCtx.HomeDir, inBuf, clientCtx.Codec) - if err != nil { - return fmt.Errorf("failed to lookup keyring: %w", err) - } - - info, err := kb.Key(args[0]) - if err != nil { - return fmt.Errorf("failed to get address from Keybase: %w", err) - } - - _, err = info.GetAddress() - if err != nil { - return fmt.Errorf("failed to get address from Keybase: %w", err) - } - } - - vestingStart, err := cmd.Flags().GetInt64(flagVestingStart) - if err != nil { - return err - } - vestingEnd, err := cmd.Flags().GetInt64(flagVestingEnd) - if err != nil { - return err - } - vestingAmtStr, err := cmd.Flags().GetString(flagVestingAmt) - if err != nil { - return err - } - - vestingAmt, err := sdk.ParseCoinsNormalized(vestingAmtStr) - if err != nil { - return fmt.Errorf("failed to parse vesting amount: %w", err) - } - - // create concrete account type based on input parameters - var genAccount authtypes.GenesisAccount - - balances := banktypes.Balance{Address: addr.String(), Coins: coins.Sort()} - baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) - - if !vestingAmt.IsZero() { - baseVestingAccount := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) - - 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 { - genAccount = baseAccount - } - - if err := genAccount.Validate(); err != nil { - return fmt.Errorf("failed to validate new genesis account: %w", err) - } - - genFile := config.GenesisFile() - appState, genDoc, err := genutiltypes.GenesisStateFromGenFile(genFile) - if err != nil { - return fmt.Errorf("failed to unmarshal genesis state: %w", err) - } - - authGenState := authtypes.GetGenesisStateFromAppState(cdc, appState) - - accs, err := authtypes.UnpackAccounts(authGenState.Accounts) - if err != nil { - return fmt.Errorf("failed to get accounts from any: %w", err) - } - - if accs.Contains(addr) { - return fmt.Errorf("cannot add account at existing address %s", addr) - } - - // Add the new account to the set of genesis accounts and sanitize the - // accounts afterwards. - accs = append(accs, genAccount) - accs = authtypes.SanitizeGenesisAccounts(accs) - - genAccs, err := authtypes.PackAccounts(accs) - if err != nil { - return fmt.Errorf("failed to convert accounts into any's: %w", err) - } - authGenState.Accounts = genAccs - - authGenStateBz, err := cdc.MarshalJSON(&authGenState) - if err != nil { - return fmt.Errorf("failed to marshal auth genesis state: %w", err) - } - - appState[authtypes.ModuleName] = authGenStateBz - - bankGenState := banktypes.GetGenesisStateFromAppState(cdc, appState) - bankGenState.Balances = append(bankGenState.Balances, balances) - bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) - - bankGenStateBz, err := cdc.MarshalJSON(bankGenState) - if err != nil { - return fmt.Errorf("failed to marshal bank genesis state: %w", err) - } - - appState[banktypes.ModuleName] = bankGenStateBz - - appStateJSON, err := json.Marshal(appState) - if err != nil { - return fmt.Errorf("failed to marshal application genesis state: %w", err) - } - - genDoc.AppState = appStateJSON - return genutil.ExportGenesisFile(genDoc, genFile) - }, - } - - cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|kwallet|pass|test)") - cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") - cmd.Flags().String(flagVestingAmt, "", "amount of coins for vesting accounts") - cmd.Flags().Int64(flagVestingStart, 0, "schedule start time (unix epoch) for vesting accounts") - cmd.Flags().Int64(flagVestingEnd, 0, "schedule end time (unix epoch) for vesting accounts") - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/cmd/prefixes.go b/cmd/prefixes.go deleted file mode 100644 index 8124eb9a..00000000 --- a/cmd/prefixes.go +++ /dev/null @@ -1,21 +0,0 @@ -package cmd - -// DONTCOVER - -import sdk "github.com/cosmos/cosmos-sdk/types" - -func SetPrefixes(accountAddressPrefix string) { - // Set prefixes - accountPubKeyPrefix := accountAddressPrefix + "pub" - validatorAddressPrefix := accountAddressPrefix + "valoper" - validatorPubKeyPrefix := accountAddressPrefix + "valoperpub" - consNodeAddressPrefix := accountAddressPrefix + "valcons" - consNodePubKeyPrefix := accountAddressPrefix + "valconspub" - - // Set and seal config - config := sdk.GetConfig() - config.SetBech32PrefixForAccount(accountAddressPrefix, accountPubKeyPrefix) - config.SetBech32PrefixForValidator(validatorAddressPrefix, validatorPubKeyPrefix) - config.SetBech32PrefixForConsensusNode(consNodeAddressPrefix, consNodePubKeyPrefix) - config.Seal() -} diff --git a/cmd/root.go b/cmd/root.go deleted file mode 100644 index 701f8ed0..00000000 --- a/cmd/root.go +++ /dev/null @@ -1,497 +0,0 @@ -package cmd - -// DONTCOVER - -import ( - "errors" - "io" - "os" - "path/filepath" - - dbm "github.com/cometbft/cometbft-db" - tmcfg "github.com/cometbft/cometbft/config" - tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cometbft/cometbft/libs/log" - tmtypes "github.com/cometbft/cometbft/types" - "github.com/cosmos/cosmos-sdk/baseapp" - "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/rpc" - "github.com/cosmos/cosmos-sdk/server" - serverconfig "github.com/cosmos/cosmos-sdk/server/config" - servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/snapshots" - snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" - "github.com/cosmos/cosmos-sdk/store" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/crisis" - "github.com/cosmos/cosmos-sdk/x/genutil" - genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - "github.com/spf13/cast" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -type ( - // AppBuilder is a method that allows to build an app - AppBuilder func( - logger log.Logger, - db dbm.DB, - traceStore io.Writer, - loadLatest bool, - skipUpgradeHeights map[int64]bool, - homePath string, - invCheckPeriod uint, - encodingConfig EncodingConfig, - appOpts servertypes.AppOptions, - baseAppOptions ...func(*baseapp.BaseApp), - ) App - - // App represents a Cosmos SDK application that can be run as a server and with an exportable state - App interface { - servertypes.Application - ExportableApp - } - - // ExportableApp represents an app with an exportable state - ExportableApp interface { - ExportAppStateAndValidators( - forZeroHeight bool, - jailAllowedAddrs []string, - modulesToExport []string, - ) (servertypes.ExportedApp, error) - LoadHeight(height int64) error - } - - // appCreator is an app creator - appCreator struct { - encodingConfig EncodingConfig - buildApp AppBuilder - } -) - -// Option configures root command option. -type Option func(*rootOptions) - -// scaffoldingOptions keeps set of options to apply scaffolding. -type rootOptions struct { - addSubCmds []*cobra.Command - startCmdCustomizer func(*cobra.Command) - envPrefix string -} - -func newRootOptions(options ...Option) rootOptions { - opts := rootOptions{} - opts.apply(options...) - return opts -} - -func (s *rootOptions) apply(options ...Option) { - for _, o := range options { - o(s) - } -} - -// AddSubCmd adds sub commands. -func AddSubCmd(cmd ...*cobra.Command) Option { - return func(o *rootOptions) { - o.addSubCmds = append(o.addSubCmds, cmd...) - } -} - -// CustomizeStartCmd accepts a handler to customize the start command. -func CustomizeStartCmd(h func(startCmd *cobra.Command)) Option { - return func(o *rootOptions) { - o.startCmdCustomizer = h - } -} - -// WithEnvPrefix accepts a new prefix for environment variables. -func WithEnvPrefix(envPrefix string) Option { - return func(o *rootOptions) { - o.envPrefix = envPrefix - } -} - -// NewRootCmd creates a new root command for a Cosmos SDK application -func NewRootCmd( - appName, - accountAddressPrefix, - defaultNodeHome, - defaultChainID string, - moduleBasics module.BasicManager, - buildApp AppBuilder, - options ...Option, -) (*cobra.Command, EncodingConfig) { - rootOptions := newRootOptions(options...) - - // Set config for prefixes - SetPrefixes(accountAddressPrefix) - - encodingConfig := MakeEncodingConfig(moduleBasics) - initClientCtx := client.Context{}. - WithCodec(encodingConfig.Marshaler). - WithInterfaceRegistry(encodingConfig.InterfaceRegistry). - WithTxConfig(encodingConfig.TxConfig). - WithLegacyAmino(encodingConfig.Amino). - WithInput(os.Stdin). - WithAccountRetriever(types.AccountRetriever{}). - WithBroadcastMode(flags.BroadcastSync). - WithHomeDir(defaultNodeHome). - WithViper(rootOptions.envPrefix) - - rootCmd := &cobra.Command{ - Use: appName + "d", - Short: "Stargate CosmosHub App", - PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { - // set the default command outputs - cmd.SetOut(cmd.OutOrStdout()) - cmd.SetErr(cmd.ErrOrStderr()) - initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags()) - if err != nil { - return err - } - initClientCtx, err = config.ReadFromClientConfig(initClientCtx) - if err != nil { - return err - } - - if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { - return err - } - - customAppTemplate, customAppConfig := initAppConfig() - - if err := server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, tmcfg.DefaultConfig()); err != nil { - return err - } - - // startProxyForTunneledPeers(initClientCtx, cmd) - - return nil - }, - } - - initRootCmd( - rootCmd, - encodingConfig, - defaultNodeHome, - moduleBasics, - buildApp, - rootOptions, - ) - overwriteFlagDefaults(rootCmd, map[string]string{ - flags.FlagChainID: defaultChainID, - flags.FlagKeyringBackend: "test", - }) - - return rootCmd, encodingConfig -} - -func initRootCmd( - rootCmd *cobra.Command, - encodingConfig EncodingConfig, - defaultNodeHome string, - moduleBasics module.BasicManager, - buildApp AppBuilder, - options rootOptions, -) { - gentxModule := moduleBasics[genutiltypes.ModuleName].(genutil.AppModuleBasic) - rootCmd.AddCommand( - genutilcli.InitCmd(moduleBasics, defaultNodeHome), - genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, defaultNodeHome, gentxModule.GenTxValidator), - genutilcli.MigrateGenesisCmd(), - genutilcli.GenTxCmd( - moduleBasics, - encodingConfig.TxConfig, - banktypes.GenesisBalancesIterator{}, - defaultNodeHome, - ), - genutilcli.ValidateGenesisCmd(moduleBasics), - AddGenesisAccountCmd(defaultNodeHome), - tmcli.NewCompletionCmd(rootCmd, true), - debug.Cmd(), - config.Cmd(), - ) - - a := appCreator{ - encodingConfig, - buildApp, - } - - // add server commands - server.AddCommands( - rootCmd, - defaultNodeHome, - a.newApp, - a.appExport, - func(cmd *cobra.Command) { - addModuleInitFlags(cmd) - - if options.startCmdCustomizer != nil { - options.startCmdCustomizer(cmd) - } - }, - ) - - // add keybase, auxiliary RPC, query, and tx child commands - rootCmd.AddCommand( - rpc.StatusCommand(), - queryCommand(moduleBasics), - txCommand(moduleBasics), - keys.Commands(defaultNodeHome), - ) - - // add user given sub commands. - for _, cmd := range options.addSubCmds { - rootCmd.AddCommand(cmd) - } -} - -// queryCommand returns the sub-command to send queries to the app -func queryCommand(moduleBasics module.BasicManager) *cobra.Command { - cmd := &cobra.Command{ - Use: "query", - Aliases: []string{"q"}, - Short: "Querying subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - authcmd.GetAccountCmd(), - rpc.ValidatorCommand(), - rpc.BlockCommand(), - authcmd.QueryTxsByEventsCmd(), - authcmd.QueryTxCmd(), - ) - - moduleBasics.AddQueryCommands(cmd) - cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") - - return cmd -} - -// txCommand returns the sub-command to send transactions to the app -func txCommand(moduleBasics module.BasicManager) *cobra.Command { - cmd := &cobra.Command{ - Use: "tx", - Short: "Transactions subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - authcmd.GetSignCommand(), - authcmd.GetSignBatchCommand(), - authcmd.GetMultiSignCommand(), - authcmd.GetValidateSignaturesCommand(), - flags.LineBreak, - authcmd.GetBroadcastCommand(), - authcmd.GetEncodeCommand(), - authcmd.GetDecodeCommand(), - ) - - moduleBasics.AddTxCommands(cmd) - cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") - - return cmd -} - -func addModuleInitFlags(startCmd *cobra.Command) { - crisis.AddModuleInitFlags(startCmd) -} - -func overwriteFlagDefaults(c *cobra.Command, defaults map[string]string) { - set := func(s *pflag.FlagSet, key, val string) { - if f := s.Lookup(key); f != nil { - f.DefValue = val - f.Value.Set(val) // nolint - } - } - for key, val := range defaults { - set(c.Flags(), key, val) - set(c.PersistentFlags(), key, val) - } - for _, c := range c.Commands() { - overwriteFlagDefaults(c, defaults) - } -} - -// newApp creates a new Cosmos SDK app -func (a appCreator) newApp( - logger log.Logger, - db dbm.DB, - traceStore io.Writer, - appOpts servertypes.AppOptions, -) servertypes.Application { - var cache sdk.MultiStorePersistentCache - - if cast.ToBool(appOpts.Get(server.FlagInterBlockCache)) { - cache = store.NewCommitKVStoreCacheManager() - } - - skipUpgradeHeights := make(map[int64]bool) - for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) { - skipUpgradeHeights[int64(h)] = true - } - - pruningOpts, err := server.GetPruningOptionsFromFlags(appOpts) - if err != nil { - panic(err) - } - - homeDir := cast.ToString(appOpts.Get(flags.FlagHome)) - chainID := cast.ToString(appOpts.Get(flags.FlagChainID)) - if chainID == "" { - // fallback to genesis chain-id - appGenesis, err := tmtypes.GenesisDocFromFile(filepath.Join(homeDir, "config", "genesis.json")) - if err != nil { - panic(err) - } - - chainID = appGenesis.ChainID - } - - snapshotDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data", "snapshots") - snapshotDB, err := dbm.NewDB("metadata", dbm.GoLevelDBBackend, snapshotDir) - if err != nil { - panic(err) - } - snapshotStore, err := snapshots.NewStore(snapshotDB, snapshotDir) - if err != nil { - panic(err) - } - - snapshotOptions := snapshottypes.NewSnapshotOptions( - cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval)), - cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent)), - ) - - return a.buildApp( - logger, - db, - traceStore, - true, - skipUpgradeHeights, - cast.ToString(appOpts.Get(flags.FlagHome)), - cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), - a.encodingConfig, - appOpts, - baseapp.SetPruning(pruningOpts), - baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))), - baseapp.SetMinRetainBlocks(cast.ToUint64(appOpts.Get(server.FlagMinRetainBlocks))), - 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))), - baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))), - baseapp.SetSnapshot(snapshotStore, snapshotOptions), - baseapp.SetChainID(chainID), - ) -} - -// appExport creates a new simapp (optionally at a given height) -func (a appCreator) 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 exportableApp ExportableApp - - homePath, ok := appOpts.Get(flags.FlagHome).(string) - if !ok || homePath == "" { - return servertypes.ExportedApp{}, errors.New("application home not set") - } - - exportableApp = a.buildApp( - logger, - db, - traceStore, - height == -1, // -1: no height provided - map[int64]bool{}, - homePath, - uint(1), - a.encodingConfig, - appOpts, - ) - - if height != -1 { - if err := exportableApp.LoadHeight(height); err != nil { - return servertypes.ExportedApp{}, err - } - } - - return exportableApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) -} - -// 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" - - 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 -} diff --git a/config-test.yml b/config-test.yml index ea26ba54..7646e246 100644 --- a/config-test.yml +++ b/config-test.yml @@ -1,16 +1,26 @@ +version: 1 +validation: sovereign build: - binary: "fundraisingd" - ldflags: ["-X github.com/tendermint/fundraising/x/fundraising/keeper.enableAddAllowedBidder=true"] + ldflags: [ "-X github.com/tendermint/fundraising/x/fundraising/keeper.enableAddAllowedBidder=true" ] accounts: - name: alice # cosmos1zaavvzxez0elundtn32qnk9lkm8kmcszzsv80v mnemonic: "guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host" - coins: ["1000000000000stake","1000000000000000denom1","1000000000000000denom2"] + coins: + - 1000000000000stake + - 1000000000000000denom1 + - 1000000000000000denom2 - name: bob # cosmos1mzgucqnfr2l8cj5apvdpllhzt4zeuh2cshz5xu mnemonic: "friend excite rough reopen cover wheel spoon convince island path clean monkey play snow number walnut pull lock shoot hurry dream divide concert discover" - coins: ["1000000000000stake","1000000000000000denom1","1000000000000000denom2"] + coins: + - 1000000000000stake + - 1000000000000000denom1 + - 1000000000000000denom2 - name: steve # cosmos185fflsvwrz0cx46w6qada7mdy92m6kx4gqx0ny mnemonic: "fuel obscure melt april direct second usual hair leave hobby beef bacon solid drum used law mercy worry fat super must ritual bring faculty" - coins: [1000000000000stake,"1000000000000000denom1","1000000000000000denom2"] + coins: + - 1000000000000stake + - 1000000000000000denom1 + - 1000000000000000denom2 validator: name: alice staked: "500000000000stake" diff --git a/config.yml b/config.yml index a38da08e..5d880f20 100644 --- a/config.yml +++ b/config.yml @@ -1,38 +1,34 @@ version: 1 +validation: sovereign build: - binary: fundraisingd - ldflags: - - -X github.com/tendermint/fundraising/x/fundraising/keeper.enableAddAllowedBidder=false - proto: - path: proto - third_party_paths: - - third_party/proto - - proto_vendor + ldflags: [ "-X github.com/tendermint/fundraising/x/fundraising/keeper.enableAddAllowedBidder=true" ] accounts: -- name: alice - coins: - - 2000000000000stake - - 1000000000000000denom1 - - 1000000000000000denom2 -- name: bob - coins: - - 2000000000000stake - - 1000000000000000denom1 -- name: steve - coins: - - 1000000000000000denom2 -faucet: - name: alice - coins: - - 100000stake - - 1000000denom1 - - 1000000denom2 - host: 0.0.0.0:4500 + - name: alice # cosmos1zaavvzxez0elundtn32qnk9lkm8kmcszzsv80v + mnemonic: "guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host" + coins: + - 1000000000000stake + - 1000000000000000denom1 + - 1000000000000000denom2 + - name: bob # cosmos1mzgucqnfr2l8cj5apvdpllhzt4zeuh2cshz5xu + mnemonic: "friend excite rough reopen cover wheel spoon convince island path clean monkey play snow number walnut pull lock shoot hurry dream divide concert discover" + coins: + - 1000000000000stake + - 1000000000000000denom1 + - 1000000000000000denom2 + - name: steve # cosmos185fflsvwrz0cx46w6qada7mdy92m6kx4gqx0ny + mnemonic: "fuel obscure melt april direct second usual hair leave hobby beef bacon solid drum used law mercy worry fat super must ritual bring faculty" + coins: + - 1000000000000stake + - 1000000000000000denom1 + - 1000000000000000denom2 client: - typescript: - path: ts-client openapi: - path: client/docs/static/openapi.yml + path: docs/static/openapi.yml +faucet: + name: bob + coins: + - 5token + - 100000stake validators: -- name: alice - bonded: 1000000000000stake + - name: alice + bonded: 500000000000stake diff --git a/docs/docs.go b/docs/docs.go new file mode 100644 index 00000000..6994b8c9 --- /dev/null +++ b/docs/docs.go @@ -0,0 +1,40 @@ +package docs + +import ( + "embed" + httptemplate "html/template" + "net/http" + + "github.com/gorilla/mux" +) + +const ( + apiFile = "/static/openapi.yml" + indexFile = "template/index.tpl" +) + +//go:embed static +var Static embed.FS + +//go:embed template +var template embed.FS + +func RegisterOpenAPIService(appName string, rtr *mux.Router) { + rtr.Handle(apiFile, http.FileServer(http.FS(Static))) + rtr.HandleFunc("/", handler(appName)) +} + +// handler returns an http handler that servers OpenAPI console for an OpenAPI spec at specURL. +func handler(title string) http.HandlerFunc { + t, _ := httptemplate.ParseFS(template, indexFile) + + return func(w http.ResponseWriter, req *http.Request) { + _ = t.Execute(w, struct { + Title string + URL string + }{ + title, + apiFile, + }) + } +} diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml new file mode 100644 index 00000000..8eccd932 --- /dev/null +++ b/docs/static/openapi.yml @@ -0,0 +1 @@ +{"id":"github.com/tendermint/fundraising","consumes":["application/json"],"produces":["application/json"],"swagger":"2.0","info":{"description":"Chain github.com/tendermint/fundraising REST API","title":"HTTP API Console","contact":{"name":"github.com/tendermint/fundraising"},"version":"version not set"},"paths":{"/fundraising.fundraising.v1.Msg/AddAllowedBidder":{"post":{"tags":["Msg"],"summary":"AddAllowedBidder defines a method sto add a single allowed bidder message.\nThis is for the testing purpose and it must not be used in mainnet.","operationId":"GithubComtendermintfundraisingMsg_AddAllowedBidder","parameters":[{"description":"MsgAddAllowedBidder defines a SDK message for adding an allowed bidder to the\nauction.","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/fundraising.fundraising.v1.MsgAddAllowedBidder"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/fundraising.fundraising.v1.MsgAddAllowedBidderResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/fundraising.fundraising.v1.Msg/CancelAuction":{"post":{"tags":["Msg"],"summary":"CancelAuction defines a method to cancel the auction message.","operationId":"GithubComtendermintfundraisingMsg_CancelAuction","parameters":[{"description":"MsgCancelAuction defines a SDK message for cancelling the auction.\nCancelling is only allowed when the auction hasn't started yet.","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/fundraising.fundraising.v1.MsgCancelAuction"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/fundraising.fundraising.v1.MsgCancelAuctionResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/fundraising.fundraising.v1.Msg/CreateBatchAuction":{"post":{"tags":["Msg"],"summary":"CreateBatchAuction submits a create batch auction message.","operationId":"GithubComtendermintfundraisingMsg_CreateBatchAuction","parameters":[{"description":"MsgCreateBatchAuction defines a SDK message for creating an batch\nauction.\n\nSee:\nhttps://github.com/tendermint/fundraising/tree/main/x/fundraising/spec/04_messages.md","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/fundraising.fundraising.v1.MsgCreateBatchAuction"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/fundraising.fundraising.v1.MsgCreateBatchAuctionResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/fundraising.fundraising.v1.Msg/CreateFixedPriceAuction":{"post":{"tags":["Msg"],"summary":"CreateFixedPriceAuction submits a create fixed price auction message.","operationId":"GithubComtendermintfundraisingMsg_CreateFixedPriceAuction","parameters":[{"description":"MsgCreateFixedPriceAuction defines a SDK message for creating a fixed price\nauction.","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/fundraising.fundraising.v1.MsgCreateFixedPriceAuction"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/fundraising.fundraising.v1.MsgCreateFixedPriceAuctionResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/fundraising.fundraising.v1.Msg/ModifyBid":{"post":{"tags":["Msg"],"summary":"ModifyBid defines a method to modify the bid message.","operationId":"GithubComtendermintfundraisingMsg_ModifyBid","parameters":[{"description":"MsgModifyBid defines a SDK message for modifying an existing bid for the\nauction.","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/fundraising.fundraising.v1.MsgModifyBid"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/fundraising.fundraising.v1.MsgModifyBidResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/fundraising.fundraising.v1.Msg/PlaceBid":{"post":{"tags":["Msg"],"summary":"PlaceBid defines a method to place a bid message.","operationId":"GithubComtendermintfundraisingMsg_PlaceBid","parameters":[{"description":"MsgPlaceBid defines a SDK message for placing a bid for the auction.","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/fundraising.fundraising.v1.MsgPlaceBid"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/fundraising.fundraising.v1.MsgPlaceBidResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/fundraising.fundraising.v1.Msg/UpdateParams":{"post":{"tags":["Msg"],"summary":"UpdateParams defines a (governance) operation for updating the module\nparameters. The authority defaults to the x/gov module account.","operationId":"GithubComtendermintfundraisingMsg_UpdateParams","parameters":[{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/fundraising.fundraising.v1.MsgUpdateParams"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/fundraising.fundraising.v1.MsgUpdateParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/tendermint/fundraising/fundraising/auction":{"get":{"tags":["Query"],"summary":"Queries a list of Auction items.","operationId":"GithubComtendermintfundraisingQuery_ListAuction","parameters":[{"type":"string","name":"status","in":"query"},{"type":"string","name":"type","in":"query"},{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/fundraising.fundraising.v1.QueryAllAuctionResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/tendermint/fundraising/fundraising/auction/{auction_id}":{"get":{"tags":["Query"],"operationId":"GithubComtendermintfundraisingQuery_GetAuction","parameters":[{"type":"string","format":"uint64","name":"auction_id","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/fundraising.fundraising.v1.QueryGetAuctionResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/tendermint/fundraising/fundraising/auction/{auction_id}/allowed_bidder":{"get":{"tags":["Query"],"summary":"Queries a list of AllowedBidder items.","operationId":"GithubComtendermintfundraisingQuery_ListAllowedBidder","parameters":[{"type":"string","format":"uint64","name":"auction_id","in":"path","required":true},{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/fundraising.fundraising.v1.QueryAllAllowedBidderResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/tendermint/fundraising/fundraising/auction/{auction_id}/allowed_bidder/{bidder}":{"get":{"tags":["Query"],"operationId":"GithubComtendermintfundraisingQuery_GetAllowedBidder","parameters":[{"type":"string","format":"uint64","name":"auction_id","in":"path","required":true},{"type":"string","name":"bidder","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/fundraising.fundraising.v1.QueryGetAllowedBidderResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/tendermint/fundraising/fundraising/auction/{auction_id}/bid":{"get":{"tags":["Query"],"summary":"Queries a list of Bid items.","operationId":"GithubComtendermintfundraisingQuery_ListBid","parameters":[{"type":"string","format":"uint64","name":"auction_id","in":"path","required":true},{"type":"string","name":"bidder","in":"query"},{"type":"string","name":"is_matched","in":"query"},{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/fundraising.fundraising.v1.QueryAllBidResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/tendermint/fundraising/fundraising/auction/{auction_id}/bid/{bid_id}":{"get":{"tags":["Query"],"operationId":"GithubComtendermintfundraisingQuery_GetBid","parameters":[{"type":"string","format":"uint64","name":"auction_id","in":"path","required":true},{"type":"string","format":"uint64","name":"bid_id","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/fundraising.fundraising.v1.QueryGetBidResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/tendermint/fundraising/fundraising/auction/{auction_id}/vestings":{"get":{"tags":["Query"],"summary":"Queries a list of VestingQueue items.","operationId":"GithubComtendermintfundraisingQuery_ListVestingQueue","parameters":[{"type":"string","format":"uint64","name":"auction_id","in":"path","required":true},{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/fundraising.fundraising.v1.QueryAllVestingQueueResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/tendermint/fundraising/fundraising/v1/params":{"get":{"tags":["Query"],"summary":"Parameters queries the parameters of the module.","operationId":"GithubComtendermintfundraisingQuery_Params","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/fundraising.fundraising.v1.QueryParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}}},"definitions":{"cosmos.base.query.v1beta1.PageRequest":{"description":"message SomeRequest {\n Foo some_parameter = 1;\n PageRequest pagination = 2;\n }","type":"object","title":"PageRequest is to be embedded in gRPC request messages for efficient\npagination. Ex:","properties":{"count_total":{"description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","type":"boolean"},"key":{"description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","type":"string","format":"byte"},"limit":{"description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","type":"string","format":"uint64"},"offset":{"description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","type":"string","format":"uint64"},"reverse":{"description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","type":"boolean"}}},"cosmos.base.query.v1beta1.PageResponse":{"description":"PageResponse is to be embedded in gRPC response messages where the\ncorresponding request message has used PageRequest.\n\n message SomeResponse {\n repeated Bar results = 1;\n PageResponse page = 2;\n }","type":"object","properties":{"next_key":{"description":"next_key is the key to be passed to PageRequest.key to\nquery the next page most efficiently. It will be empty if\nthere are no more results.","type":"string","format":"byte"},"total":{"type":"string","format":"uint64","title":"total is total number of results available if PageRequest.count_total\nwas set, its value is undefined otherwise"}}},"cosmos.base.v1beta1.Coin":{"description":"Coin defines a token with a denomination and an amount.\n\nNOTE: The amount field is an Int which implements the custom method\nsignatures required by gogoproto.","type":"object","properties":{"amount":{"type":"string"},"denom":{"type":"string"}}},"fundraising.fundraising.v1.AllowedBidder":{"description":"AllowedBidder defines an allowed bidder for the auction.","type":"object","properties":{"auction_id":{"type":"string","format":"uint64","title":"auction_id specifies the id of the auction"},"bidder":{"type":"string","title":"bidder specifies the bech32-encoded address that bids for the auction"},"max_bid_amount":{"type":"string","title":"max_bid_amount specifies the maximum bid amount that the bidder can bid"}}},"fundraising.fundraising.v1.Bid":{"description":"Bid defines a standard bid for an auction.","type":"object","properties":{"auction_id":{"type":"string","format":"uint64","title":"auction_id specifies the id of the auction"},"bidder":{"type":"string","title":"bidder specifies the bech32-encoded address that bids for the auction"},"coin":{"description":"coin specifies the amount of coin that the bidder bids\nfor a fixed price auction, the denom is of the paying coin.\nfor a batch auction of how-much-worth, the denom is of the paying coin.\nfor a batch auction of how-many-coins, the denom is of the selling coin.","$ref":"#/definitions/cosmos.base.v1beta1.Coin"},"id":{"type":"string","format":"uint64","title":"id specifies an index of a bid for the bidder"},"is_matched":{"type":"boolean","title":"is_matched specifies the bid that is a winning bid and enables the bidder\nto purchase the selling coin"},"price":{"type":"string","title":"price specifies the bid price in which price the bidder places the bid"},"type":{"title":"type specifies the bid type; type 1 is fixed price, 2 is how-much-worth, 3\nis how-many-coins","$ref":"#/definitions/fundraising.fundraising.v1.BidType"}}},"fundraising.fundraising.v1.BidType":{"description":"BidType enumerates the valid types of a bid.\n\n - BID_TYPE_UNSPECIFIED: BID_TYPE_UNSPECIFIED defines the default bid type\n - BID_TYPE_FIXED_PRICE: BID_TYPE_FIXED_PRICE defines a bid type for a fixed price auction type\n - BID_TYPE_BATCH_WORTH: BID_TYPE_BATCH_WORTH defines a bid type for How-Much-Worth-to-Buy of a\nbatch auction\n - BID_TYPE_BATCH_MANY: BID_TYPE_BATCH_MANY defines a bid type for How-Many-Coins-to-Buy of a batch\nauction","type":"string","default":"BID_TYPE_UNSPECIFIED","enum":["BID_TYPE_UNSPECIFIED","BID_TYPE_FIXED_PRICE","BID_TYPE_BATCH_WORTH","BID_TYPE_BATCH_MANY"]},"fundraising.fundraising.v1.MsgAddAllowedBidder":{"description":"MsgAddAllowedBidder defines a SDK message for adding an allowed bidder to the\nauction.","type":"object","properties":{"allowed_bidder":{"title":"allowed_bidder specifies the bidder who is allowed to bid and their maximum\nbid amount","$ref":"#/definitions/fundraising.fundraising.v1.AllowedBidder"},"auction_id":{"type":"string","format":"uint64","title":"auction_id specifies the auction id"}}},"fundraising.fundraising.v1.MsgAddAllowedBidderResponse":{"description":"MsgAddAllowedBidderResponse defines the Msg/MsgAddAllowedBidderResponse response type.","type":"object"},"fundraising.fundraising.v1.MsgCancelAuction":{"description":"MsgCancelAuction defines a SDK message for cancelling the auction.\nCancelling is only allowed when the auction hasn't started yet.","type":"object","properties":{"auction_id":{"type":"string","format":"uint64","title":"auction_id specifies the auction id"},"auctioneer":{"type":"string","title":"auctioneer specifies the bech32-encoded address that is in charge of the\nauction"}}},"fundraising.fundraising.v1.MsgCancelAuctionResponse":{"description":"MsgCancelAuctionResponse defines the Msg/MsgCancelAuctionResponse\nresponse type.","type":"object"},"fundraising.fundraising.v1.MsgCreateBatchAuction":{"description":"MsgCreateBatchAuction defines a SDK message for creating an batch\nauction.\n\nSee:\nhttps://github.com/tendermint/fundraising/tree/main/x/fundraising/spec/04_messages.md","type":"object","properties":{"auctioneer":{"type":"string","title":"auctioneer specifies the bech32-encoded address that creates the auction"},"end_time":{"type":"string","format":"date-time","title":"end_time specifies the end time of the plan"},"extended_round_rate":{"type":"string","title":"extended_round_rate specifies the rate that decides if the auction needs\nanother round"},"max_extended_round":{"type":"integer","format":"int64","title":"maximum_extended_round specifies the maximum number of extended rounds for\nthe auction"},"min_bid_price":{"type":"string","title":"min_bid_price specifies the minibum bid price"},"paying_coin_denom":{"type":"string","title":"paying_coin_denom specifies the paying coin denom that bidders use to bid\nfor"},"selling_coin":{"title":"selling_coin specifies the selling coin for the auction","$ref":"#/definitions/cosmos.base.v1beta1.Coin"},"start_price":{"type":"string","title":"start_price specifies the starting price of the auction"},"start_time":{"type":"string","format":"date-time","title":"start_time specifies the start time of the plan"},"vesting_schedules":{"type":"array","title":"vesting_schedules specifies the vesting schedules for the auction","items":{"type":"object","$ref":"#/definitions/fundraising.fundraising.v1.VestingSchedule"}}}},"fundraising.fundraising.v1.MsgCreateBatchAuctionResponse":{"description":"MsgCreateBatchAuctionResponse defines the\nMsg/MsgCreateBatchAuctionResponse response type.","type":"object"},"fundraising.fundraising.v1.MsgCreateFixedPriceAuction":{"description":"MsgCreateFixedPriceAuction defines a SDK message for creating a fixed price\nauction.","type":"object","properties":{"auctioneer":{"type":"string","title":"auctioneer specifies the bech32-encoded address that creates the auction"},"end_time":{"type":"string","format":"date-time","title":"end_time specifies the end time of the plan"},"paying_coin_denom":{"type":"string","title":"paying_coin_denom specifies the paying coin denom that bidders use to bid\nfor"},"selling_coin":{"title":"selling_coin specifies the selling coin for the auction","$ref":"#/definitions/cosmos.base.v1beta1.Coin"},"start_price":{"type":"string","title":"start_price specifies the starting price of the auction"},"start_time":{"type":"string","format":"date-time","title":"start_time specifies the start time of the plan"},"vesting_schedules":{"type":"array","title":"vesting_schedules specifies the vesting schedules for the auction","items":{"type":"object","$ref":"#/definitions/fundraising.fundraising.v1.VestingSchedule"}}}},"fundraising.fundraising.v1.MsgCreateFixedPriceAuctionResponse":{"description":"MsgCreateFixedPriceAuctionResponse defines the\nMsg/MsgCreateFixedPriceAuctionResponse response type.","type":"object"},"fundraising.fundraising.v1.MsgModifyBid":{"description":"MsgModifyBid defines a SDK message for modifying an existing bid for the\nauction.","type":"object","properties":{"auction_id":{"type":"string","format":"uint64","title":"auction_id specifies the auction id"},"bid_id":{"type":"string","format":"uint64","title":"bid_id specifies the bid id"},"bidder":{"type":"string","title":"bidder specifies the bech32-encoded address that bids for the auction"},"coin":{"title":"coin specifies the paying amount of coin or the selling amount that the\nbidder bids","$ref":"#/definitions/cosmos.base.v1beta1.Coin"},"price":{"description":"price specifies the bid price.\nthe bide price must be above or equal to the original value that the bidder\nplaced.","type":"string"}}},"fundraising.fundraising.v1.MsgModifyBidResponse":{"description":"MsgModifyBidResponse defines the Msg/MsgModifyBidResponse response type.","type":"object"},"fundraising.fundraising.v1.MsgPlaceBid":{"description":"MsgPlaceBid defines a SDK message for placing a bid for the auction.","type":"object","properties":{"auction_id":{"type":"string","format":"uint64","title":"auction_id specifies the auction id"},"bid_type":{"title":"type specifies the bid type; type 1 is fixed price, 2 is how-much-worth, 3\nis how-many-coins","$ref":"#/definitions/fundraising.fundraising.v1.BidType"},"bidder":{"type":"string","title":"bidder specifies the bech32-encoded address that bids for the auction"},"coin":{"title":"coin specifies the paying amount of coin or the selling amount that the\nbidder bids","$ref":"#/definitions/cosmos.base.v1beta1.Coin"},"price":{"description":"price specifies the bid price.\nThe bid price must be the start price for fixed price auction whereas\nthe bide price can be any value that the bidder places.","type":"string"}}},"fundraising.fundraising.v1.MsgPlaceBidResponse":{"description":"MsgPlaceBidResponse defines the Msg/MsgPlaceBidResponse response type.","type":"object"},"fundraising.fundraising.v1.MsgUpdateParams":{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","type":"object","properties":{"authority":{"description":"authority is the address that controls the module (defaults to x/gov unless overwritten).","type":"string"},"params":{"description":"NOTE: All parameters must be supplied.","$ref":"#/definitions/fundraising.fundraising.v1.Params"}}},"fundraising.fundraising.v1.MsgUpdateParamsResponse":{"description":"MsgUpdateParamsResponse defines the response structure for executing a\nMsgUpdateParams message.","type":"object"},"fundraising.fundraising.v1.Params":{"description":"Params defines the parameters for the module.","type":"object","properties":{"auction_creation_fee":{"type":"array","title":"auction_creation_fee specifies the fee for auction creation.\nthis prevents from spamming attack and it is collected in the community\npool","items":{"type":"object","$ref":"#/definitions/cosmos.base.v1beta1.Coin"}},"extended_period":{"type":"integer","format":"int64","title":"extended_period specifies the extended period that determines how long\nthe extended auction round lasts"},"place_bid_fee":{"type":"array","title":"place_bid_fee specifies the fee for placing a bid for an auction.\nthis prevents from spamming attack and it is collected in the community\npool","items":{"type":"object","$ref":"#/definitions/cosmos.base.v1beta1.Coin"}}}},"fundraising.fundraising.v1.QueryAllAllowedBidderResponse":{"description":"QueryAllowedBidderResponse is the response type for the Query/AllowedBidder RPC method.","type":"object","properties":{"allowed_bidder":{"type":"array","items":{"type":"object","$ref":"#/definitions/fundraising.fundraising.v1.AllowedBidder"}},"pagination":{"title":"pagination defines the pagination in the response","$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"}}},"fundraising.fundraising.v1.QueryAllAuctionResponse":{"description":"QueryAllAuctionResponse is response type for the Query/Auctions RPC method.","type":"object","properties":{"auction":{"type":"array","title":"auctions specifies the existing auctions","items":{"type":"object","$ref":"#/definitions/google.protobuf.Any"}},"pagination":{"title":"pagination defines the pagination in the response","$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"}}},"fundraising.fundraising.v1.QueryAllBidResponse":{"description":"QueryBidsResponse is response type for the Query/Bids RPC method.","type":"object","properties":{"bid":{"type":"array","title":"bids specifies the existing bids","items":{"type":"object","$ref":"#/definitions/fundraising.fundraising.v1.Bid"}},"pagination":{"title":"pagination defines the pagination in the response","$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"}}},"fundraising.fundraising.v1.QueryAllVestingQueueResponse":{"description":"QueryAllVestingQueueResponse is response type for the Query/Vestings RPC method.","type":"object","properties":{"pagination":{"$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"},"vestingQueue":{"type":"array","title":"vestings specifies the existing vestings","items":{"type":"object","$ref":"#/definitions/fundraising.fundraising.v1.VestingQueue"}}}},"fundraising.fundraising.v1.QueryGetAllowedBidderResponse":{"description":"QueryAllowedBidderResponse is the response type for the Query/AllowedBidder\nRPC method.","type":"object","properties":{"allowed_bidder":{"$ref":"#/definitions/fundraising.fundraising.v1.AllowedBidder"}}},"fundraising.fundraising.v1.QueryGetAuctionResponse":{"description":"QueryGetAuctionResponse is the response type for the Query/Auction RPC method.","type":"object","properties":{"auction":{"$ref":"#/definitions/google.protobuf.Any"}}},"fundraising.fundraising.v1.QueryGetBidResponse":{"description":"QueryGetBidResponse is response type for the Query/Sequence RPC method.","type":"object","properties":{"bid":{"title":"bid specifies specific bid","$ref":"#/definitions/fundraising.fundraising.v1.Bid"}}},"fundraising.fundraising.v1.QueryParamsResponse":{"description":"QueryParamsResponse is response type for the Query/Params RPC method.","type":"object","properties":{"params":{"description":"params holds all the parameters of this module.","$ref":"#/definitions/fundraising.fundraising.v1.Params"}}},"fundraising.fundraising.v1.VestingQueue":{"description":"VestingQueue defines the vesting queue.","type":"object","properties":{"auction_id":{"type":"string","format":"uint64","title":"auction_id specifies the id of the auction"},"auctioneer":{"type":"string","title":"auctioneer specifies the bech32-encoded address that creates the auction"},"paying_coin":{"title":"paying_coin specifies the paying amount of coin","$ref":"#/definitions/cosmos.base.v1beta1.Coin"},"release_time":{"type":"string","format":"date-time","title":"release_time specifies the timestamp of the vesting schedule"},"released":{"type":"boolean","title":"released specifies the status of distribution"}}},"fundraising.fundraising.v1.VestingSchedule":{"description":"VestingSchedule defines the vesting schedule for the owner of an auction.","type":"object","properties":{"release_time":{"type":"string","format":"date-time","title":"release_time specifies the time for distribution of the vesting coin"},"weight":{"type":"string","title":"weight specifies the vesting weight for the schedule"}}},"google.protobuf.Any":{"type":"object","properties":{"@type":{"type":"string"}},"additionalProperties":{}},"google.rpc.Status":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"details":{"type":"array","items":{"type":"object","$ref":"#/definitions/google.protobuf.Any"}},"message":{"type":"string"}}}},"tags":[{"name":"Query"},{"name":"Msg"}]} \ No newline at end of file diff --git a/docs/template/index.tpl b/docs/template/index.tpl new file mode 100644 index 00000000..ec098e82 --- /dev/null +++ b/docs/template/index.tpl @@ -0,0 +1,28 @@ + + + + + {{ .Title }} + + + + +
+ + + + + +Footer +© 2022 GitHub, Inc. +Footer navigation diff --git a/go.mod b/go.mod index fec3993d..b36f6074 100644 --- a/go.mod +++ b/go.mod @@ -1,339 +1,259 @@ module github.com/tendermint/fundraising -go 1.19 +go 1.21 + +replace ( + // fix upstream GHSA-h395-qcrw-5vmq vulnerability. + github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0 + // replace broken goleveldb + github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 +) require ( - cosmossdk.io/api v0.3.1 - cosmossdk.io/math v1.0.1 - cosmossdk.io/simapp v0.0.0-20230224204036-a6adb0821462 - github.com/bufbuild/buf v1.22.0 - github.com/cometbft/cometbft v0.37.2 - github.com/cometbft/cometbft-db v0.8.0 - github.com/cosmos/cosmos-proto v1.0.0-beta.2 - github.com/cosmos/cosmos-sdk v0.47.3 - github.com/cosmos/gogoproto v1.4.10 + cosmossdk.io/api v0.7.5 + cosmossdk.io/client/v2 v2.0.0-beta.4 + cosmossdk.io/collections v0.4.0 + cosmossdk.io/core v0.11.0 + cosmossdk.io/depinject v1.0.0-alpha.4 + cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.3.1 + cosmossdk.io/math v1.3.0 + cosmossdk.io/store v1.1.0 + cosmossdk.io/tools/confix v0.1.1 + cosmossdk.io/x/circuit v0.1.0 + cosmossdk.io/x/evidence v0.1.0 + cosmossdk.io/x/feegrant v0.1.0 + cosmossdk.io/x/nft v0.1.0 + cosmossdk.io/x/upgrade v0.1.4 + github.com/bufbuild/buf v1.32.1 + github.com/cometbft/cometbft v0.38.10 + github.com/cosmos/cosmos-db v1.0.2 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/cosmos-sdk v0.50.8 + github.com/cosmos/gogoproto v1.5.0 + github.com/cosmos/ibc-go/modules/capability v1.0.0 + github.com/cosmos/ibc-go/v8 v8.3.1 github.com/gogo/protobuf v1.3.2 - github.com/golang/protobuf v1.5.3 - github.com/golangci/golangci-lint v1.50.1 - github.com/gorilla/mux v1.8.0 + github.com/golang/protobuf v1.5.4 + github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 - github.com/spf13/cast v1.5.1 - github.com/spf13/cobra v1.7.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 + github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.8.4 - golang.org/x/tools v0.10.0 - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 - google.golang.org/grpc v1.55.0 - google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 - google.golang.org/protobuf v1.31.0 - gopkg.in/yaml.v2 v2.4.0 + github.com/spf13/viper v1.19.0 + github.com/stretchr/testify v1.9.0 + golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 + golang.org/x/tools v0.21.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240515191416-fc5f0ca64291 + google.golang.org/grpc v1.64.0 + google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 + google.golang.org/protobuf v1.34.2 mvdan.cc/gofumpt v0.4.0 ) -replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - require ( - 4d63.com/gochecknoglobals v0.1.0 // indirect - cloud.google.com/go v0.110.0 // indirect - cloud.google.com/go/compute v1.19.1 // 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.29.0 // indirect - cosmossdk.io/core v0.5.1 // indirect - cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - cosmossdk.io/errors v1.0.0-beta.7 // indirect - cosmossdk.io/log v1.1.0 // indirect - cosmossdk.io/tools/rosetta v0.2.1 // indirect + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.1-20240508200655-46a4cf4ba109.1 // indirect + buf.build/gen/go/bufbuild/registry/connectrpc/go v1.16.1-20240514010100-299bd9c9a0c4.1 // indirect + buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.34.1-20240514010100-299bd9c9a0c4.1 // indirect + cloud.google.com/go v0.112.1 // indirect + cloud.google.com/go/compute/metadata v0.3.0 // indirect + cloud.google.com/go/iam v1.1.6 // indirect + cloud.google.com/go/storage v1.38.0 // indirect + connectrpc.com/connect v1.16.1 // indirect + connectrpc.com/otelconnect v0.7.0 // indirect + cosmossdk.io/x/tx v0.13.3 // 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/Abirdcfly/dupword v0.0.7 // indirect - github.com/Antonboom/errname v0.1.7 // indirect - github.com/Antonboom/nilnil v0.1.1 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect - github.com/BurntSushi/toml v1.2.1 // indirect - github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect - github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect - github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 // indirect - github.com/Masterminds/semver v1.5.0 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect + github.com/DataDog/zstd v1.5.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/OpenPeeDeeP/depguard v1.1.1 // indirect - github.com/alexkohler/prealloc v1.0.0 // indirect - github.com/alingse/asasalint v0.0.11 // indirect - github.com/armon/go-metrics v0.4.1 // indirect - github.com/ashanbrown/forbidigo v1.3.0 // indirect - github.com/ashanbrown/makezero v1.1.1 // indirect - github.com/aws/aws-sdk-go v1.44.244 // indirect + github.com/antlr4-go/antlr/v4 v4.13.0 // 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/bkielbasa/cyclop v1.2.0 // indirect - github.com/blizzy78/varnamelen v0.8.0 // indirect - github.com/bombsimon/wsl/v3 v3.3.0 // indirect - github.com/breml/bidichk v0.2.3 // indirect - github.com/breml/errchkjson v0.3.0 // indirect + github.com/bits-and-blooms/bitset v1.8.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/bufbuild/connect-go v1.8.0 // indirect - github.com/bufbuild/connect-opentelemetry-go v0.3.0 // indirect - github.com/bufbuild/protocompile v0.5.1 // indirect - github.com/butuzov/ireturn v0.1.1 // indirect - github.com/cenkalti/backoff/v4 v4.1.3 // indirect + github.com/bufbuild/protocompile v0.13.1-0.20240510201809-752249dfc37f // indirect + github.com/bufbuild/protoplugin v0.0.0-20240323223605-e2735f6c31ee // indirect + github.com/bufbuild/protovalidate-go v0.6.2 // indirect + github.com/bufbuild/protoyaml-go v0.1.9 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/charithe/durationcheck v0.0.9 // indirect - github.com/chavacava/garif v0.0.0-20220630083739-93517212f375 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect - github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect - github.com/confio/ics23/go v0.9.0 // indirect - github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/pebble v1.1.0 // 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.9.1 // indirect + github.com/containerd/stargz-snapshotter/estargz v0.15.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 v0.20.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.12.1 // indirect - github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect - github.com/creachadair/taskgroup v0.4.2 // indirect - github.com/curioswitch/go-reassign v0.2.0 // indirect - github.com/daixiang0/gci v0.8.1 // 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.1.0 // indirect - github.com/denis-tingaikin/go-header v0.4.3 // indirect + github.com/cosmos/iavl v1.1.2 // indirect + github.com/cosmos/ics23/go v0.10.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/creachadair/atomicfile v0.3.1 // indirect + github.com/creachadair/tomledit v0.0.24 // 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.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/docker/cli v24.0.2+incompatible // indirect - github.com/docker/distribution v2.8.2+incompatible // indirect - github.com/docker/docker v24.0.2+incompatible // indirect - github.com/docker/docker-credential-helpers v0.7.0 // indirect - github.com/docker/go-connections v0.4.0 // indirect + github.com/distribution/reference v0.6.0 // indirect + github.com/docker/cli v26.1.2+incompatible // indirect + github.com/docker/distribution v2.8.3+incompatible // indirect + github.com/docker/docker v26.1.2+incompatible // indirect + github.com/docker/docker-credential-helpers v0.8.1 // indirect + github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/esimonov/ifshort v1.0.4 // indirect - github.com/ettle/strcase v0.1.1 // indirect - github.com/fatih/color v1.13.0 // indirect - github.com/fatih/structtag v1.2.0 // indirect - github.com/felixge/fgprof v0.9.3 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/firefart/nonamedreturns v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/fzipp/gocyclo v0.6.0 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/emicklei/dot v1.6.1 // indirect + github.com/fatih/color v1.15.0 // indirect + github.com/felixge/fgprof v0.9.4 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect - github.com/go-chi/chi/v5 v5.0.8 // indirect - github.com/go-critic/go-critic v0.6.5 // indirect + github.com/go-chi/chi/v5 v5.0.12 // 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-logr/logr v1.2.4 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-playground/universal-translator v0.18.0 // indirect - github.com/go-toolsmith/astcast v1.0.0 // indirect - github.com/go-toolsmith/astcopy v1.0.2 // indirect - github.com/go-toolsmith/astequal v1.0.3 // indirect - github.com/go-toolsmith/astfmt v1.0.0 // indirect - github.com/go-toolsmith/astp v1.0.0 // indirect - github.com/go-toolsmith/strparse v1.0.0 // indirect - github.com/go-toolsmith/typep v1.0.2 // indirect - github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b // indirect - github.com/gobwas/glob v0.2.3 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect - github.com/gofrs/flock v0.8.1 // indirect - github.com/gofrs/uuid/v5 v5.0.0 // indirect + github.com/gofrs/uuid/v5 v5.2.0 // indirect github.com/gogo/googleapis v1.4.1 // indirect - github.com/golang/glog v1.1.0 // indirect + github.com/golang/glog v1.2.0 // 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/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect - github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect - github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe // indirect - github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2 // indirect - github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 // indirect - github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca // indirect - github.com/golangci/misspell v0.3.5 // indirect - github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 // indirect - github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect - github.com/google/go-containerregistry v0.15.2 // indirect + github.com/google/cel-go v0.20.1 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/google/go-containerregistry v0.19.1 // indirect github.com/google/orderedcode v0.0.1 // indirect - github.com/google/pprof v0.0.0-20230602150820-91b7bce49751 // 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/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8 // indirect - github.com/gorilla/handlers v1.5.1 // indirect + github.com/google/pprof v0.0.0-20240509144519-723abb6459b7 // indirect + github.com/google/s2a-go v0.1.7 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect + github.com/googleapis/gax-go/v2 v2.12.3 // indirect + github.com/gorilla/handlers v1.5.2 // indirect github.com/gorilla/websocket v1.5.0 // indirect - github.com/gostaticanalysis/analysisutil v0.7.1 // indirect - github.com/gostaticanalysis/comment v1.4.2 // indirect - github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect - github.com/gostaticanalysis/nilerr v0.1.1 // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/gtank/merlin v0.1.1 // indirect - github.com/gtank/ristretto255 v0.1.2 // indirect - github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.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-multierror v1.1.1 // indirect + github.com/hashicorp/go-metrics v0.5.3 // 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/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // 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/hexops/gotextdiff v1.0.3 // 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/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84 // indirect - github.com/jgautheron/goconst v1.5.1 // indirect - github.com/jingyugao/rowserrcheck v1.1.1 // indirect - github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect + github.com/jdx/go-netrc v1.0.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/julz/importas v0.1.0 // indirect - github.com/kisielk/errcheck v1.6.2 // indirect - github.com/kisielk/gotool v1.0.0 // indirect - github.com/kkHAIKE/contextcheck v1.1.3 // indirect - github.com/klauspost/compress v1.16.6 // indirect + github.com/klauspost/compress v1.17.8 // indirect github.com/klauspost/pgzip v1.2.6 // indirect - github.com/kulti/thelper v0.6.3 // indirect - github.com/kunwardeep/paralleltest v1.0.6 // indirect - github.com/kyoh86/exportloopref v0.1.8 // indirect - github.com/ldez/gomoddirectives v0.2.3 // indirect - github.com/ldez/tagliatelle v0.3.1 // indirect - github.com/leodido/go-urn v1.2.1 // indirect - github.com/leonklingele/grouper v1.1.0 // 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.7.16 // indirect - github.com/lufeee/execinquery v1.2.1 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect - github.com/maratori/testableexamples v1.0.0 // indirect - github.com/maratori/testpackage v1.1.0 // indirect - github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.18 // indirect - github.com/mattn/go-runewidth v0.0.9 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mbilski/exhaustivestruct v1.2.0 // indirect - github.com/mgechev/revive v1.2.4 // indirect - github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/minio/highwayhash v1.0.2 // 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/moby/docker-image-spec v1.3.1 // indirect github.com/moby/term v0.5.0 // indirect - github.com/moricho/tparallel v0.2.1 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/nakabonne/nestif v0.3.1 // indirect - github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect - github.com/nishanths/exhaustive v0.8.3 // indirect - github.com/nishanths/predeclared v0.2.2 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect + github.com/oklog/run v1.1.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc3 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect - github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect + github.com/opencontainers/image-spec v1.1.0 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect + github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pkg/profile v1.7.0 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/polyfloyd/go-errorlint v1.0.5 // indirect - github.com/prometheus/client_golang v1.14.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.9.0 // indirect - github.com/quasilyte/go-ruleguard v0.3.18 // indirect - github.com/quasilyte/gogrep v0.0.0-20220828223005-86e4605de09f // indirect - github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95 // indirect - github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect - github.com/rakyll/statik v0.1.7 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rs/cors v1.9.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.0 // indirect + github.com/rs/zerolog v1.32.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/ryancurrah/gomodguard v1.2.4 // indirect - github.com/ryanrolds/sqlclosecheck v0.3.0 // indirect - github.com/sanposhiho/wastedassign/v2 v2.0.6 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/sashamelentyev/interfacebloat v1.1.0 // indirect - github.com/sashamelentyev/usestdlibvars v1.20.0 // indirect - github.com/securego/gosec/v2 v2.13.1 // indirect - github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/sivchari/containedctx v1.0.2 // indirect - github.com/sivchari/nosnakecase v1.7.0 // indirect - github.com/sivchari/tenv v1.7.0 // indirect - github.com/sonatard/noctx v0.0.1 // indirect - github.com/sourcegraph/go-diff v0.6.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/ssgreg/nlreturn/v2 v2.2.1 // indirect - github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect - github.com/stretchr/objx v0.5.0 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cast v1.6.0 // indirect + github.com/stoewer/go-strcase v1.3.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/tdakkota/asciicheck v0.1.1 // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tetafro/godot v1.4.11 // indirect - github.com/tetratelabs/wazero v1.2.1 // indirect - github.com/tidwall/btree v1.6.0 // indirect - github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144 // indirect - github.com/timonwong/loggercheck v0.9.3 // indirect - github.com/tomarrell/wrapcheck/v2 v2.7.0 // indirect - github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect - github.com/ugorji/go/codec v1.2.7 // indirect + github.com/tidwall/btree v1.7.0 // indirect github.com/ulikunitz/xz v0.5.11 // indirect - github.com/ultraware/funlen v0.0.3 // indirect - github.com/ultraware/whitespace v0.0.5 // indirect - github.com/uudashr/gocognit v1.0.6 // indirect - github.com/vbatts/tar-split v0.11.3 // indirect - github.com/yagipy/maintidx v1.0.0 // indirect - github.com/yeya24/promlinter v0.2.0 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect - gitlab.com/bosi/decorder v0.2.3 // indirect - go.etcd.io/bbolt v1.3.7 // indirect + github.com/vbatts/tar-split v0.11.5 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + go.etcd.io/bbolt v1.3.8 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/otel v1.16.0 // indirect - go.opentelemetry.io/otel/metric v1.16.0 // indirect - go.opentelemetry.io/otel/sdk v1.16.0 // indirect - go.opentelemetry.io/otel/trace v1.16.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect + go.opentelemetry.io/otel v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect + go.opentelemetry.io/otel/metric v1.28.0 // indirect + go.opentelemetry.io/otel/sdk v1.28.0 // indirect + go.opentelemetry.io/otel/trace v1.28.0 // indirect + go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.24.0 // indirect - golang.org/x/crypto v0.10.0 // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect - golang.org/x/exp/typeparams v0.0.0-20220827204233-334a2380cb91 // indirect - golang.org/x/mod v0.11.0 // indirect - golang.org/x/net v0.11.0 // indirect - golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.9.0 // indirect - golang.org/x/term v0.9.0 // indirect - golang.org/x/text v0.10.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 + go.uber.org/zap v1.27.0 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/oauth2 v0.20.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/term v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect + golang.org/x/time v0.5.0 // indirect + google.golang.org/api v0.171.0 // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // 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 - honnef.co/go/tools v0.3.3 // indirect - mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect - mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect - mvdan.cc/unparam v0.0.0-20220706161116-678bad134442 // indirect + gotest.tools/v3 v3.5.1 // indirect nhooyr.io/websocket v1.8.6 // indirect - pgregory.net/rapid v0.5.5 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + pgregory.net/rapid v1.1.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index a40a6df1..a60a0636 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,15 @@ -4d63.com/gochecknoglobals v0.1.0 h1:zeZSRqj5yCg28tCkIV/z/lWbwvNm5qnKVS15PI8nhD0= -4d63.com/gochecknoglobals v0.1.0/go.mod h1:wfdC5ZjKSPr7CybKEcgJhUOgeAQW1+7WcyK8OvUilfo= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.1-20240401165935-b983156c5e99.1/go.mod h1:XF+P8+RmfdufmIYpGUC+6bF7S+IlmHDEnCrO3OXaUAQ= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.1-20240508200655-46a4cf4ba109.1 h1:LEXWFH/xZ5oOWrC3oOtHbUyBdzRWMCPpAQmKC9v05mA= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.1-20240508200655-46a4cf4ba109.1/go.mod h1:XF+P8+RmfdufmIYpGUC+6bF7S+IlmHDEnCrO3OXaUAQ= +buf.build/gen/go/bufbuild/registry/connectrpc/go v1.16.1-20240514010100-299bd9c9a0c4.1 h1:6GN3XU5DaLjZb2vdle1za4TCwRHlEXMGSFCmHz4FM3w= +buf.build/gen/go/bufbuild/registry/connectrpc/go v1.16.1-20240514010100-299bd9c9a0c4.1/go.mod h1:3Vwq3HRCNOcnv99Ra+/8K5cntwO/Gw98cIjsjQVxf4E= +buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.34.1-20240514010100-299bd9c9a0c4.1 h1:zrXXp1IT3qukIKorguvnrw/JzxYttBrXzktUQGiQHqA= +buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.34.1-20240514010100-299bd9c9a0c4.1/go.mod h1:8ONhsyCTLQ9kBslWnMgPrXTcxzCkKlxZqN9ewUveui8= 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= @@ -18,7 +22,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= @@ -34,8 +37,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.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= +cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= 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= @@ -72,10 +75,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.1 h1:am86mquDUgjGNWxiGn+5PGLbmgiWXlE/yNWpIpNvuXY= -cloud.google.com/go/compute v1.19.1/go.mod h1:6ylj3a05WF8leseCdIf77NK0g1ey+nj5IKd5/kvShxE= -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.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= 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= @@ -113,13 +114,12 @@ 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.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= +cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= 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/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= @@ -173,12 +173,11 @@ 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.29.0 h1:6weCgzRvMg7lzuUurI4697AqIRPU1SvzHhynwpW31jI= -cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= +cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg= +cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY= 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/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -190,22 +189,42 @@ 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.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= -cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= -cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= -cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= -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= -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/simapp v0.0.0-20230224204036-a6adb0821462 h1:g8muUHnXL8vhld2Sjilyhb1UQObc+x9GVuDK43TYZns= -cosmossdk.io/simapp v0.0.0-20230224204036-a6adb0821462/go.mod h1:4Dd3NLoLYoN90kZ0uyHoTHzVVk9+J0v4HhZRBNTAq2c= -cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= -cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= +connectrpc.com/connect v1.16.1 h1:rOdrK/RTI/7TVnn3JsVxt3n028MlTRwmK5Q4heSpjis= +connectrpc.com/connect v1.16.1/go.mod h1:XpZAduBQUySsb4/KO5JffORVkDI4B6/EYPi7N8xpNZw= +connectrpc.com/otelconnect v0.7.0 h1:ZH55ZZtcJOTKWWLy3qmL4Pam4RzRWBJFOqTPyAqCXkY= +connectrpc.com/otelconnect v0.7.0/go.mod h1:Bt2ivBymHZHqxvo4HkJ0EwHuUzQN6k2l0oH+mp/8nwc= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/client/v2 v2.0.0-beta.4 h1:LGIzWbVTOof/IHQZeoWwxPX0fq607ONXhsfA7eUrQIg= +cosmossdk.io/client/v2 v2.0.0-beta.4/go.mod h1:c753d0sBv3AQRx6X+BOKL1aGpKjZMTZAHGiLPbVi5TE= +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.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= +cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +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.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= +cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= +cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= +cosmossdk.io/tools/confix v0.1.1 h1:aexyRv9+y15veH3Qw16lxQwo+ki7r2I+g0yNTEFEQM8= +cosmossdk.io/tools/confix v0.1.1/go.mod h1:nQVvP1tHsGXS83PonPVWJtSbddIqyjEw99L4M3rPJyQ= +cosmossdk.io/x/circuit v0.1.0 h1:IAej8aRYeuOMritczqTlljbUVHq1E85CpBqaCTwYgXs= +cosmossdk.io/x/circuit v0.1.0/go.mod h1:YDzblVE8+E+urPYQq5kq5foRY/IzhXovSYXb4nwd39w= +cosmossdk.io/x/evidence v0.1.0 h1:J6OEyDl1rbykksdGynzPKG5R/zm6TacwW2fbLTW4nCk= +cosmossdk.io/x/evidence v0.1.0/go.mod h1:hTaiiXsoiJ3InMz1uptgF0BnGqROllAN8mwisOMMsfw= +cosmossdk.io/x/feegrant v0.1.0 h1:c7s3oAq/8/UO0EiN1H5BIjwVntujVTkYs35YPvvrdQk= +cosmossdk.io/x/feegrant v0.1.0/go.mod h1:4r+FsViJRpcZif/yhTn+E0E6OFfg4n0Lx+6cCtnZElU= +cosmossdk.io/x/nft v0.1.0 h1:VhcsFiEK33ODN27kxKLa0r/CeFd8laBfbDBwYqCyYCM= +cosmossdk.io/x/nft v0.1.0/go.mod h1:ec4j4QAO4mJZ+45jeYRnW7awLHby1JZANqe1hNZ4S3g= +cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= +cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= +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= @@ -213,72 +232,50 @@ 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/Abirdcfly/dupword v0.0.7 h1:z14n0yytA3wNO2gpCD/jVtp/acEXPGmYu0esewpBt6Q= -github.com/Abirdcfly/dupword v0.0.7/go.mod h1:K/4M1kj+Zh39d2aotRwypvasonOyAMH1c/IZJzE0dmk= -github.com/Antonboom/errname v0.1.7 h1:mBBDKvEYwPl4WFFNwec1CZO096G6vzK9vvDQzAwkako= -github.com/Antonboom/errname v0.1.7/go.mod h1:g0ONh16msHIPgJSGsecu1G/dcF2hlYR/0SddnIAGavU= -github.com/Antonboom/nilnil v0.1.1 h1:PHhrh5ANKFWRBh7TdYmyyq2gyT2lotnvFvvFbylF81Q= -github.com/Antonboom/nilnil v0.1.1/go.mod h1:L1jBqoWM7AOeTD+tSquifKSesRHs4ZdaxvZR+xdJEaI= 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/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= -github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= +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/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= -github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 h1:+r1rSv4gvYn0wmRjC8X7IAzX8QezqtFV9m0MUHFJgts= -github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0/go.mod h1:b3g59n2Y+T5xmcxJL+UEG2f8cQploZm1mR/v6BW0mU0= +github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= +github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= 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/OpenPeeDeeP/depguard v1.1.1 h1:TSUznLjvp/4IUP+OQ0t/4jF4QUyxIcVX8YnghZdunyA= -github.com/OpenPeeDeeP/depguard v1.1.1/go.mod h1:JtAMzWkmFEzDPyAd+W0NHl1lvpQKTvT9jnRVsohBKpc= 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.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -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/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= -github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= -github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= -github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= +github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= 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/ashanbrown/forbidigo v1.3.0 h1:VkYIwb/xxdireGAdJNZoo24O4lmnEWkactplBlWTShc= -github.com/ashanbrown/forbidigo v1.3.0/go.mod h1:vVW7PEdqEFqapJe95xHkTfB1+XvZXBFg8t0sG2FIxmI= -github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= -github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= 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.244 h1:QzBWLD5HjZHdRZyTMTOWtD9Pobzf1n8/CeTJB4giXi0= -github.com/aws/aws-sdk-go v1.44.244/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +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/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= +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= @@ -288,48 +285,40 @@ 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/bkielbasa/cyclop v1.2.0 h1:7Jmnh0yL2DjKfw28p86YTd/B4lRGcNuu12sKE35sM7A= -github.com/bkielbasa/cyclop v1.2.0/go.mod h1:qOI0yy6A7dYC4Zgsa72Ppm9kONl0RoIlPbzot9mhmeI= -github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= -github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= -github.com/bombsimon/wsl/v3 v3.3.0 h1:Mka/+kRLoQJq7g2rggtgQsjuI/K5Efd87WX96EWFxjM= -github.com/bombsimon/wsl/v3 v3.3.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= -github.com/breml/bidichk v0.2.3 h1:qe6ggxpTfA8E75hdjWPZ581sY3a2lnl0IRxLQFelECI= -github.com/breml/bidichk v0.2.3/go.mod h1:8u2C6DnAy0g2cEq+k/A2+tr9O1s+vHGxWn0LTc70T2A= -github.com/breml/errchkjson v0.3.0 h1:YdDqhfqMT+I1vIxPSas44P+9Z9HzJwCeAzjB8PxP1xw= -github.com/breml/errchkjson v0.3.0/go.mod h1:9Cogkyv9gcT8HREpzi3TiqBxCqDzo8awa92zSDFcofU= +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.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.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= +github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= +github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/bufbuild/buf v1.22.0 h1:dCWUIx1gm3nm5U+FKdkVjaL+Rk9Ev3hh4XYMa2Cbn/o= -github.com/bufbuild/buf v1.22.0/go.mod h1:ERFRzJiIjAOzUSJ3vz1zoI7XfxlBnCwZEyL+NJm4pko= -github.com/bufbuild/connect-go v1.8.0 h1:srluNkFkZBfSfg9Qb6DrO+5nMaxix//h2ctrHZhMGKc= -github.com/bufbuild/connect-go v1.8.0/go.mod h1:GmMJYR6orFqD0Y6ZgX8pwQ8j9baizDrIQMm1/a6LnHk= -github.com/bufbuild/connect-opentelemetry-go v0.3.0 h1:AuZi3asTDKmjGtd2aqpyP4p5QvBFG/YEaHopViLatnk= -github.com/bufbuild/connect-opentelemetry-go v0.3.0/go.mod h1:r1ppyTtu1EWeRodk4Q/JbyQhIWtO7eR3GoRDzjeEcNU= -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/butuzov/ireturn v0.1.1 h1:QvrO2QF2+/Cx1WA/vETCIYBKtRjc30vesdoPUNo1EbY= -github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/bufbuild/buf v1.32.1 h1:EsGUKtT1IFRAVS52v/OYcmvUAZ3o6hb6GoEOLM7WSlU= +github.com/bufbuild/buf v1.32.1/go.mod h1:trWT7vC+ujoZayhIVBOoU8JEOUVxWDFNs4+ixc5bLEA= +github.com/bufbuild/protocompile v0.13.1-0.20240510201809-752249dfc37f h1:cQLFPZXf32tbTLzUTg0n69Vi5kddhUiZMzpMzKRW0XU= +github.com/bufbuild/protocompile v0.13.1-0.20240510201809-752249dfc37f/go.mod h1:QJcgsTVPSBEMt+/3i2M/RpwjZc+DAXyPPDg0slmMk4c= +github.com/bufbuild/protoplugin v0.0.0-20240323223605-e2735f6c31ee h1:E6ET8YUcYJ1lAe6ctR3as7yqzW2BNItDFnaB5zQq/8M= +github.com/bufbuild/protoplugin v0.0.0-20240323223605-e2735f6c31ee/go.mod h1:HjGFxsck9RObrTJp2hXQZfWhPgZqnR6sR1U5fCA/Kus= +github.com/bufbuild/protovalidate-go v0.6.2 h1:U/V3CGF0kPlR12v41rjO4DrYZtLcS4ZONLmWN+rJVCQ= +github.com/bufbuild/protovalidate-go v0.6.2/go.mod h1:4BR3rKEJiUiTy+sqsusFn2ladOf0kYmA2Reo6BHSBgQ= +github.com/bufbuild/protoyaml-go v0.1.9 h1:anV5UtF1Mlvkkgp4NWA6U/zOnJFng8Orq4Vf3ZUQHBU= +github.com/bufbuild/protoyaml-go v0.1.9/go.mod h1:KCBItkvZOK/zwGueLdH1Wx1RLyFn5rCH7YjQrdty2Wc= 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/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/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.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/charithe/durationcheck v0.0.9 h1:mPP4ucLrf/rKZiIG/a9IPXHGlh8p4CzgpyTy6EEutYk= -github.com/charithe/durationcheck v0.0.9/go.mod h1:SSbRIBVfMjCi/kEB6K65XEA83D6prSM8ap1UCpNKtgg= -github.com/chavacava/garif v0.0.0-20220630083739-93517212f375 h1:E7LT642ysztPWE0dfz43cWOvMiF42DyTRC+eZIaO4yI= -github.com/chavacava/garif v0.0.0-20220630083739-93517212f375/go.mod h1:4m1Rv7xfuwWPNKXlThldNuJvutYM6J95wNuuVmn55To= +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/chromedp/cdproto v0.0.0-20230802225258-3cf4e6d46a89/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs= +github.com/chromedp/chromedp v0.9.2/go.mod h1:LkSXJKONWTCHAfQasKFUZI+mxqS4tZqhmtGzzhLsnLs= +github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww= 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= @@ -354,20 +343,30 @@ 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/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.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= +github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= +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.0 h1:pcFh8CdCIt2kmEpK0OIatq67Ln9uGDYY3d5XnE0LJG4= +github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= +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/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.37.2 h1:XB0yyHGT0lwmJlFmM4+rsRnczPlHoAKFX6K8Zgc2/Jc= -github.com/cometbft/cometbft v0.37.2/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= -github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= -github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= -github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= -github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= +github.com/cometbft/cometbft v0.38.10 h1:2ePuglchT+j0Iao+cfmt/nw5U7K2lnGDzXSUPGVdXaU= +github.com/cometbft/cometbft v0.38.10/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= +github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= +github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= -github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSkDwbkEETK84kQgEeFwDC+62k= -github.com/containerd/stargz-snapshotter/estargz v0.14.3/go.mod h1:KY//uOCIkSuNAHhJogcZtrNHdKrA99/FCCRjE3HD36o= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= +github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU= +github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk= 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= @@ -376,50 +375,52 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV 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-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= -github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-sdk v0.47.3 h1:r0hGmZoAzP2D+MaPaFGHwAaTdFQq3pNpHaUp1BsffbM= -github.com/cosmos/cosmos-sdk v0.47.3/go.mod h1:c4OfLdAykA9zsj1CqrxBRqXzVz48I++JSvIMPSPcEmk= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= +github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= +github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= +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.8 h1:2UJHssUaGHTl4/dFp8xyREKAnfiRU6VVfqtKG9n8w5g= +github.com/cosmos/cosmos-sdk v0.50.8/go.mod h1:Zb+DgHtiByNwgj71IlJBXwOq6dLhtyAq3AgqpXm/jHo= 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 v0.20.0 h1:fTVznVlepH0KK8NyKq8w+U7c2L6jofa27aFX6YGlm38= -github.com/cosmos/iavl v0.20.0/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ledger-cosmos-go v0.12.1 h1:sMBxza5p/rNK/06nBSNmsI/WDqI0pVJFVNihy1Y984w= -github.com/cosmos/ledger-cosmos-go v0.12.1/go.mod h1:dhO6kj+Y+AHIOgAe4L9HL/6NDdyyth4q238I9yFpD2g= -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/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= +github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= +github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= +github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= +github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= +github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= +github.com/cosmos/ibc-go/v8 v8.3.1 h1:cUNWvTCftKQIcpbf2y/jVzo2OY3g4GVFw6tTC/pQ+tA= +github.com/cosmos/ibc-go/v8 v8.3.1/go.mod h1:izwHZvn9lKrBn8xWj0aXWut6HKcwHMPD3uyuvOJoPSA= +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.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= +github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= 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 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= -github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= +github.com/cpuguy83/go-md2man/v2 v2.0.4/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/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= -github.com/cristalhq/acmd v0.8.1/go.mod h1:LG5oa43pE/BbxtfMoImHCQN++0Su7dzipdgBjMCBVDQ= -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/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= -github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= -github.com/daixiang0/gci v0.8.1 h1:T4xpSC+hmsi4CSyuYfIJdMZAr9o7xZmHpQVygMghGZ4= -github.com/daixiang0/gci v0.8.1/go.mod h1:EpVfrztufwVgQRXjnX4zuNinEpLj5OmMjtu/+MB0V0c= -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/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= +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/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= -github.com/denis-tingaikin/go-header v0.4.3 h1:tEaZKAlqql6SKCY++utLmkPLd6K8IBM20Ha7UVm+mtU= -github.com/denis-tingaikin/go-header v0.4.3/go.mod h1:0wOCWuN71D5qIgE2nz9KrKmuYBAC2Mra5RassOIQ2/c= +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/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= @@ -431,28 +432,32 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm 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/cli v24.0.2+incompatible h1:QdqR7znue1mtkXIJ+ruQMGQhpw2JzMJLRXp6zpzF6tM= -github.com/docker/cli v24.0.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= -github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v24.0.2+incompatible h1:eATx+oLz9WdNVkQrr0qjQ8HvRJ4bOOxfzEo8R+dA3cg= -github.com/docker/docker v24.0.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= -github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/docker/cli v26.1.2+incompatible h1:/MWZpUMMlr1hCGyquL8QNbL1hbivQ1kLuT3Z9s1Tlpg= +github.com/docker/cli v26.1.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= +github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v26.1.2+incompatible h1:UVX5ZOrrfTGZZYEP+ZDq3Xn9PdHNXaSYMFPDumMqG2k= +github.com/docker/docker v26.1.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo= +github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= +github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= +github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= 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/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= +github.com/emicklei/dot v1.6.1/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= @@ -464,42 +469,39 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m 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/esimonov/ifshort v1.0.4 h1:6SID4yGWfRae/M7hkVDVVyppy8q/v9OuxNdmjLQStBA= -github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= -github.com/ettle/strcase v0.1.1 h1:htFueZyVeE1XNnMEfbqp5r67qAN/4r6ya1ysq8Q+Zcw= -github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= +github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= +github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= -github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= -github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw= -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/firefart/nonamedreturns v1.0.4 h1:abzI1p7mAEPYuR4A+VLKn4eNDOycjYo2phmY9sfv40Y= -github.com/firefart/nonamedreturns v1.0.4/go.mod h1:TDhe/tjI1BXo48CmYbUduTV7BdIga8MAO/xbKdcVsGI= +github.com/felixge/fgprof v0.9.4 h1:ocDNwMFlnA0NU0zSB3I52xkO4sFXk80VK9lXjLClu88= +github.com/felixge/fgprof v0.9.4/go.mod h1:yKl+ERSa++RYOs32d8K6WEXCB4uXdLls4ZaZPpayhMM= +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/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= -github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= +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/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= 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 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= -github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= -github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0= -github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= -github.com/go-critic/go-critic v0.6.5 h1:fDaR/5GWURljXwF8Eh31T2GZNz9X4jeboS912mWF8Uo= -github.com/go-critic/go-critic v0.6.5/go.mod h1:ezfP/Lh7MA6dBNn4c6ab5ALv3sKnZVLx37tr00uuaOY= +github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU= +github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s= +github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +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= @@ -517,8 +519,8 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG 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.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/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.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= @@ -528,46 +530,27 @@ github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa 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 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= -github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +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-toolsmith/astcast v1.0.0 h1:JojxlmI6STnFVG9yOImLeGREv8W2ocNUM+iOhR6jE7g= -github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= -github.com/go-toolsmith/astcopy v1.0.2 h1:YnWf5Rnh1hUudj11kei53kI57quN/VH6Hp1n+erozn0= -github.com/go-toolsmith/astcopy v1.0.2/go.mod h1:4TcEdbElGc9twQEYpVo/aieIXfHhiuLh4aLAck6dO7Y= -github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= -github.com/go-toolsmith/astequal v1.0.2/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4= -github.com/go-toolsmith/astequal v1.0.3 h1:+LVdyRatFS+XO78SGV4I3TCEA0AC7fKEGma+fH+674o= -github.com/go-toolsmith/astequal v1.0.3/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4= -github.com/go-toolsmith/astfmt v1.0.0 h1:A0vDDXt+vsvLEdbMFJAUBI/uTbRw1ffOPnxsILnFL6k= -github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw= -github.com/go-toolsmith/astp v1.0.0 h1:alXE75TXgcmupDsMK1fRAy0YUzLzqPVvBKoyWV+KPXg= -github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI= -github.com/go-toolsmith/pkgload v1.0.2-0.20220101231613-e814995d17c5 h1:eD9POs68PHkwrx7hAB78z1cb6PfGq/jyWn3wJywsH1o= -github.com/go-toolsmith/pkgload v1.0.2-0.20220101231613-e814995d17c5/go.mod h1:3NAwwmD4uY/yggRxoEjk/S00MIV3A+H7rrE3i87eYxM= -github.com/go-toolsmith/strparse v1.0.0 h1:Vcw78DnpCAKlM20kSbAyO4mPfJn/lyYA4BJUDxe2Jb4= -github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= -github.com/go-toolsmith/typep v1.0.2 h1:8xdsa1+FSIH/RhEkgnD1j2CJOy5mNllW1Q9tRiYwvlk= -github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= -github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b h1:khEcpUM4yFcxg4/FHQWkvVRmgijNXRfzkIDHh23ggEo= -github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= -github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= -github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -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/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= +github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= 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/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= +github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/gobwas/ws v1.2.1 h1:F2aeBZrm2NDsc7vbovKrWSogd4wvfAxg0FQ89/iqOTk= +github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= 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/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc= -github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M= -github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= +github.com/gofrs/uuid/v5 v5.2.0 h1:qw1GMx6/y8vhVsx626ImfKMuS5CvJmhIKKtuyvfajMM= +github.com/gofrs/uuid/v5 v5.2.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= 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= @@ -579,8 +562,8 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP 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.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= +github.com/golang/glog v1.2.0/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= @@ -615,36 +598,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/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0= -github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= -github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= -github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= -github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe h1:6RGUuS7EGotKx6J5HIP8ZtyMdiDscjMLfRBSPuzVVeo= -github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe/go.mod h1:gjqyPShc/m8pEMpk0a3SeagVb0kaqvhscv+i9jI5ZhQ= -github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2 h1:amWTbTGqOZ71ruzrdA+Nx5WA3tV1N0goTspwmKCQvBY= -github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2/go.mod h1:9wOXstvyDRshQ9LggQuzBCGysxs3b6Uo/1MvYCR2NMs= -github.com/golangci/golangci-lint v1.50.1 h1:C829clMcZXEORakZlwpk7M4iDw2XiwxxKaG504SZ9zY= -github.com/golangci/golangci-lint v1.50.1/go.mod h1:AQjHBopYS//oB8xs0y0M/dtxdKHkdhl0RvmjUct0/4w= -github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= -github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= -github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= -github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= -github.com/golangci/misspell v0.3.5 h1:pLzmVdl3VxTOncgzHcvLOKirdvcx/TydsClUQXTehjo= -github.com/golangci/misspell v0.3.5/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= -github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 h1:DIPQnGy2Gv2FSA4B/hh8Q7xx3B7AIDk3DAMeHclH1vQ= -github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6/go.mod h1:0AKcRCkMoKvUvlf89F6O7H2LYdhr1zBh736mBItOdRs= -github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys= -github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= 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/cel-go v0.20.1 h1:nDx9r8S3L4pE61eDdt8igGj8rf5kjYR3ILxWIpWNi84= +github.com/google/cel-go v0.20.1/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg= 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= @@ -659,19 +624,22 @@ 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-containerregistry v0.15.2 h1:MMkSh+tjSdnmJZO7ljvEqV1DjfekB6VUEAZgy3a+TQE= -github.com/google/go-containerregistry v0.15.2/go.mod h1:wWK+LnOv4jXMM23IT/F1wdYftGWGr47Is8CG+pmHK1Q= +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/go-containerregistry v0.19.1 h1:yMQ62Al6/V0Z7CqIrrS1iYoA5/oQCm88DeNujc7C1KY= +github.com/google/go-containerregistry v0.19.1/go.mod h1:YCMFNQeeXeLF+dnhhWkqDItx/JSkH01j1Kis4PsjzFI= 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/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= @@ -683,27 +651,28 @@ 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/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= -github.com/google/pprof v0.0.0-20230602150820-91b7bce49751 h1:hR7/MlvK23p6+lIw9SN1TigNLn9ZnF3W4SYRKq2gAHs= -github.com/google/pprof v0.0.0-20230602150820-91b7bce49751/go.mod h1:Jh3hGz2jkYak8qXPD19ryItVnUgpgeqzdkY/D0EaeuA= +github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20240509144519-723abb6459b7 h1:velgFPYr1X9TDwLIfkV7fWqsFlf7TeP11M/7kPd/dVI= +github.com/google/pprof v0.0.0-20240509144519-723abb6459b7/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= 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.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= 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.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= 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= @@ -713,74 +682,53 @@ 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.12.3 h1:5/zPPDvw8Q1SuXjrqrZslrqT7dL/uJT2CQii/cLCKqA= +github.com/googleapis/gax-go/v2 v2.12.3/go.mod h1:AKloxT6GtNbaLm8QTNSidHUVsHYcBHwWRvkNFJUQcS4= 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/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8 h1:PVRE9d4AQKmbelZ7emNig1+NT27DUmKZn5qXxfio54U= -github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= 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/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= -github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= -github.com/gostaticanalysis/analysisutil v0.1.0/go.mod h1:dMhHRU9KTiDcuLGdy87/2gTR8WruwYZrKdRq9m1O6uw= -github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk= -github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc= -github.com/gostaticanalysis/comment v1.3.0/go.mod h1:xMicKDx7XRXYdVwY9f9wQpDJVnqWxw9wCauCMKp+IBI= -github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= -github.com/gostaticanalysis/comment v1.4.2 h1:hlnx5+S2fY9Zo9ePo4AhgYsYHbM2+eAv8m/s1JiCd6Q= -github.com/gostaticanalysis/comment v1.4.2/go.mod h1:KLUTGDv6HOCotCH8h2erHKmpci2ZoR8VPu34YA2uzdM= -github.com/gostaticanalysis/forcetypeassert v0.1.0 h1:6eUflI3DiGusXGK6X7cCcIgVCpZ2CiZ1Q7jl6ZxNV70= -github.com/gostaticanalysis/forcetypeassert v0.1.0/go.mod h1:qZEedyP/sY1lTGV1uJ3VhWZ2mqag3IkWsDHVbplHXak= -github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3Uqrmrcpk= -github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= -github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= -github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoISdUv3PPQgHY= 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.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +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/grpc-ecosystem/grpc-gateway/v2 v2.15.2 h1:gDLXvp5S9izjldquuoAhDzccbskOL6tDC5jMSyx3zxE= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2/go.mod h1:7pdNwVWBBHGiCxa9lAszqCJMbfTISJ7oMftp8+UGV08= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= -github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= -github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= -github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= 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/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= -github.com/hashicorp/errwrap v1.1.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-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.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-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +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= @@ -788,51 +736,51 @@ github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoD 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-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-uuid v1.0.2/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.2.1/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.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/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 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= 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/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= -github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= 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/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-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/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= +github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= 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/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84 h1:2uT3aivO7NVpUPGcQX7RbHijHMyWix/yCnIrCWc+5co= -github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84/go.mod h1:Zi/ZFkEqFHTm7qkjyNJjaWH4LQA9LQhGJyF0lTYGpxw= -github.com/jgautheron/goconst v1.5.1 h1:HxVbL1MhydKs8R8n/HE5NPvzfaYmQJA3o879lE4+WcM= -github.com/jgautheron/goconst v1.5.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= -github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= -github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= -github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= -github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= +github.com/jdx/go-netrc v1.0.0 h1:QbLMLyCZGj0NA8glAhxUpf1zDg6cxnWgMBbjq40W0gQ= +github.com/jdx/go-netrc v1.0.0/go.mod h1:Gh9eFQJnoTNIRHXl2j5bJXA1u84hQWJWgGh569zF3v8= +github.com/jhump/protoreflect v1.16.0 h1:54fZg+49widqXYQ0b+usAFHbMkBGR4PpXrsHc8+TBDg= +github.com/jhump/protoreflect v1.16.0/go.mod h1:oYPd7nPvcBw/5wlDfm/AVmU9zH9BgqGCI469pGxfj/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= @@ -840,15 +788,14 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= -github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= 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/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -856,75 +803,45 @@ 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/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= -github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= 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/errcheck v1.6.2 h1:uGQ9xI8/pgc9iOoCe7kWQgRE6SBTrCGmTSf0LrEtY7c= -github.com/kisielk/errcheck v1.6.2/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= -github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kkHAIKE/contextcheck v1.1.3 h1:l4pNvrb8JSwRd51ojtcOxOeHJzHek+MtOyXbaR0uvmw= -github.com/kkHAIKE/contextcheck v1.1.3/go.mod h1:PG/cwd6c0705/LM0KTr1acO2gORUxkSVWyLJOFW5qoo= 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.6 h1:91SKEy4K37vkp255cJ8QesJhjyRO0hn9i9G0GoUwLsk= -github.com/klauspost/compress v1.16.6/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= +github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= 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.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/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= -github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= -github.com/kunwardeep/paralleltest v1.0.6 h1:FCKYMF1OF2+RveWlABsdnmsvJrei5aoyZoaGS+Ugg8g= -github.com/kunwardeep/paralleltest v1.0.6/go.mod h1:Y0Y0XISdZM5IKm3TREQMZ6iteqn1YuwCsJO/0kL9Zes= -github.com/kyoh86/exportloopref v0.1.8 h1:5Ry/at+eFdkX9Vsdw3qU4YkvGtzuVfzT4X7S77LoN/M= -github.com/kyoh86/exportloopref v0.1.8/go.mod h1:1tUcJeiioIs7VWe5gcOObrux3lb66+sBqGZrRkMwPgg= -github.com/ldez/gomoddirectives v0.2.3 h1:y7MBaisZVDYmKvt9/l1mjNCiSA1BVn34U0ObUcJwlhA= -github.com/ldez/gomoddirectives v0.2.3/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0= -github.com/ldez/tagliatelle v0.3.1 h1:3BqVVlReVUZwafJUwQ+oxbx2BEX2vUG4Yu/NOfMiKiM= -github.com/ldez/tagliatelle v0.3.1/go.mod h1:8s6WJQwEYHbKZDsp/LjArytKOG8qaMrKQQ3mFukHs88= +github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1yfhB7XSJJKlFZKl/J+dCPAknuiaGOshXAs= 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/leonklingele/grouper v1.1.0 h1:tC2y/ygPbMFSBOs3DcyaEMKnnwH7eYKzohOtRrf0SAg= -github.com/leonklingele/grouper v1.1.0/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= 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.7.16 h1:Q2co1xrpdkr5Hx3Fp+f+f7fRGhQFQhvi/+226dtLmA8= -github.com/linxGnu/grocksdb v1.7.16/go.mod h1:JkS7pl5qWpGpuVb3bPqTz8nC12X3YtPZT+Xq7+QfQo4= -github.com/lufeee/execinquery v1.2.1 h1:hf0Ems4SHcUGBxpGN7Jz78z1ppVkP/837ZlETPCEtOM= -github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= +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/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= -github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= -github.com/maratori/testableexamples v1.0.0/go.mod h1:4rhjL1n20TUTT4vdh3RDqSizKLyXp7K2u6HgraZCGzE= -github.com/maratori/testpackage v1.1.0 h1:GJY4wlzQhuBusMF1oahQCBtUV/AQ/k69IZ68vxaac2Q= -github.com/maratori/testpackage v1.1.0/go.mod h1:PeAhzU8qkCwdGEMTEupsHJNlQu2gZopMC6RjbhmHeDc= -github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 h1:pWxk9e//NbPwfxat7RXkts09K+dEBJWakUWwICVqYbA= -github.com/matoous/godox v0.0.0-20210227103229-6504466cf951/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= -github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= -github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= 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= @@ -935,24 +852,13 @@ github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx 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.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= -github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +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/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= 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/mbilski/exhaustivestruct v1.2.0 h1:wCBmUnSYufAHO6J4AVWY6ff+oxWxsVFrwgOdMUQePUo= -github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= -github.com/mgechev/revive v1.2.4 h1:+2Hd/S8oO2H0Ikq2+egtNwQsVhAeELHjxjIUFX5ajLI= -github.com/mgechev/revive v1.2.4/go.mod h1:iAWlQishqCuj4yhV24FTnKSXGpbAA+0SckXB8GQMX/Q= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= 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= @@ -968,6 +874,8 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F 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/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= +github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -977,8 +885,6 @@ 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/moricho/tparallel v0.2.1 h1:95FytivzT6rYzdJLdtfn6m1bfFJylOJK41+lgv/EHf4= -github.com/moricho/tparallel v0.2.1/go.mod h1:fXEIZxG2vdfl0ZF8b42f5a78EhjjD5mX8qUplsoSU4k= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= @@ -987,8 +893,6 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW 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/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= -github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= 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= @@ -996,36 +900,35 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE 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/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 h1:4kuARK6Y6FxaNu/BnU2OAaLF86eTVhP2hjTB6iMvItA= -github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nishanths/exhaustive v0.8.3 h1:pw5O09vwg8ZaditDp/nQRqVnrMczSJDxRDJMowvhsrM= -github.com/nishanths/exhaustive v0.8.3/go.mod h1:qj+zJJUgJ76tR92+25+03oYUhzF4R7/2Wk7fGTfCHmg= -github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= -github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= 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-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/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= 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.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= -github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= 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.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= +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-rc3 h1:fzg1mXZFj8YdPeNkRXMg+zb88BFV0Ys52cJydRwBkb8= -github.com/opencontainers/image-spec v1.1.0-rc3/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= +github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= +github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= 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= @@ -1034,32 +937,28 @@ 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/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= -github.com/otiai10/copy v1.2.0 h1:HvG945u96iNadPoG2/Ja2+AUJeW5YuFQMixq9yirC+k= -github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= -github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= -github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= -github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= -github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= +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.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= 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-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= -github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d h1:CdDQnGF8Nq9ocOS/xlSptM1N3BbrA6/kmaep5ggwaIA= -github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= +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/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= +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/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= +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= @@ -1067,11 +966,9 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA= github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo= -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/polyfloyd/go-errorlint v1.0.5 h1:AHB5JRCjlmelh9RrLxT9sgzpalIwwq4hqE8EkwIwKdY= -github.com/polyfloyd/go-errorlint v1.0.5/go.mod h1:APVvOesVSAnne5SClsPxPdfvZTVDojXh1/G3qb5wjGI= +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= @@ -1079,150 +976,105 @@ 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.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= 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.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -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.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= 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.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= -github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= -github.com/quasilyte/go-ruleguard v0.3.1-0.20210203134552-1b5a410e1cc8/go.mod h1:KsAh3x0e7Fkpgs+Q9pNLS5XpFSvYCEVl5gP9Pp1xp30= -github.com/quasilyte/go-ruleguard v0.3.18 h1:sd+abO1PEI9fkYennwzHn9kl3nqP6M5vE7FiOzZ+5CE= -github.com/quasilyte/go-ruleguard v0.3.18/go.mod h1:lOIzcYlgxrQ2sGJ735EHXmf/e9MJ516j16K/Ifcttvs= -github.com/quasilyte/go-ruleguard/dsl v0.3.0/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/dsl v0.3.21/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/rules v0.0.0-20201231183845-9e62ed36efe1/go.mod h1:7JTjp89EGyU1d6XfBiXihJNG37wB2VRkd125Q1u7Plc= -github.com/quasilyte/go-ruleguard/rules v0.0.0-20211022131956-028d6511ab71/go.mod h1:4cgAphtvu7Ftv7vOT2ZOYhC6CvBxZixcasr8qIOTA50= -github.com/quasilyte/gogrep v0.0.0-20220828223005-86e4605de09f h1:6Gtn2i04RD0gVyYf2/IUMTIs+qYleBt4zxDqkLTcu4U= -github.com/quasilyte/gogrep v0.0.0-20220828223005-86e4605de09f/go.mod h1:Cm9lpz9NZjEoL1tgZ2OgeUKPIxL1meE7eo60Z6Sk+Ng= -github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95 h1:L8QM9bvf68pVdQ3bCFZMDmnt9yqcMBro1pC7F+IPYMY= -github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= -github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs= -github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= -github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= -github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= 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.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.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.9.0 h1:l9HGsTsHJcvW14Nk7J9KFz8bzeAWXn3CG6bgt7LsrAE= -github.com/rs/cors v1.9.0/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/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= +github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= +github.com/rs/zerolog v1.32.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 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryancurrah/gomodguard v1.2.4 h1:CpMSDKan0LtNGGhPrvupAoLeObRFjND8/tU1rEOtBp4= -github.com/ryancurrah/gomodguard v1.2.4/go.mod h1:+Kem4VjWwvFpUJRJSwa16s1tBJe+vbv02+naTow2f6M= -github.com/ryanrolds/sqlclosecheck v0.3.0 h1:AZx+Bixh8zdUBxUA1NxbxVAS78vTPq4rCb8OUZI9xFw= -github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0KCtEdgEkHwDbigdA= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/sanposhiho/wastedassign/v2 v2.0.6 h1:+6/hQIHKNJAUixEj6EmOngGIisyeI+T3335lYTyxRoA= -github.com/sanposhiho/wastedassign/v2 v2.0.6/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= 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/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= -github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= -github.com/sashamelentyev/usestdlibvars v1.20.0 h1:K6CXjqqtSYSsuyRDDC7Sjn6vTMLiSJa4ZmDkiokoqtw= -github.com/sashamelentyev/usestdlibvars v1.20.0/go.mod h1:0GaP+ecfZMXShS0A94CJn6aEuPRILv8h/VuWI9n1ygg= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/securego/gosec/v2 v2.13.1 h1:7mU32qn2dyC81MH9L2kefnQyRMUarfDER3iQyMHcjYM= -github.com/securego/gosec/v2 v2.13.1/go.mod h1:EO1sImBMBWFjOTFzMWfTRrZW6M15gm60ljzrmy/wtHo= -github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= -github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= 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/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/sivchari/containedctx v1.0.2 h1:0hLQKpgC53OVF1VT7CeoFHk9YKstur1XOgfYIc1yrHI= -github.com/sivchari/containedctx v1.0.2/go.mod h1:PwZOeqm4/DLoJOqMSIJs3aKqXRX4YO+uXww087KZ7Bw= -github.com/sivchari/nosnakecase v1.7.0 h1:7QkpWIRMe8x25gckkFd2A5Pi6Ymo0qgr4JrhGt95do8= -github.com/sivchari/nosnakecase v1.7.0/go.mod h1:CwDzrzPea40/GB6uynrNLiorAlgFRvRbFSgJx2Gs+QY= -github.com/sivchari/tenv v1.7.0 h1:d4laZMBK6jpe5PWepxlV9S+LC0yXqvYHiq8E6ceoVVE= -github.com/sivchari/tenv v1.7.0/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= 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/sonatard/noctx v0.0.1 h1:VC1Qhl6Oxx9vvWo3UDgrGXYCeKCe3Wbw7qAWL6FrmTY= -github.com/sonatard/noctx v0.0.1/go.mod h1:9D2D/EoULe8Yy2joDHJj7bv3sZoq9AaSb8B4lqBjiZI= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/sourcegraph/go-diff v0.6.1 h1:hmA1LzxW0n1c3Q4YbrFgg4P99GSnebYa3x8gr0HZqLQ= -github.com/sourcegraph/go-diff v0.6.1/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= +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.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= 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.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/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.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= 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/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/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= -github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= -github.com/stbenjam/no-sprintf-host-port v0.1.1 h1:tYugd/yrm1O0dV+ThCbaKZh195Dfm07ysF0U6JQXczc= -github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= +github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= +github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= +github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= +github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= 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/testify v1.1.4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +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= @@ -1230,81 +1082,50 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 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.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.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.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/tdakkota/asciicheck v0.1.1 h1:PKzG7JUTUmVspQTDqtkX9eSiLGossXTybutHwTXuO0A= -github.com/tdakkota/asciicheck v0.1.1/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= 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/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA= -github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= -github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag= -github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= -github.com/tetafro/godot v1.4.11 h1:BVoBIqAf/2QdbFmSwAWnaIqDivZdOV0ZRwEm6jivLKw= -github.com/tetafro/godot v1.4.11/go.mod h1:LR3CJpxDVGlYOWn3ZZg1PgNZdTUvzsZWu8xaEohUpn8= -github.com/tetratelabs/wazero v1.2.1 h1:J4X2hrGzJvt+wqltuvcSjHQ7ujQxA9gb6PeMs4qlUWs= -github.com/tetratelabs/wazero v1.2.1/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144 h1:kl4KhGNsJIbDHS9/4U9yQo1UcPQM0kOMJHn29EoH/Ro= -github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= -github.com/timonwong/loggercheck v0.9.3 h1:ecACo9fNiHxX4/Bc02rW2+kaJIAMAes7qJ7JKxt0EZI= -github.com/timonwong/loggercheck v0.9.3/go.mod h1:wUqnk9yAOIKtGA39l1KLE9Iz0QiTocu/YZoOf+OzFdw= +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/tomarrell/wrapcheck/v2 v2.7.0 h1:J/F8DbSKJC83bAvC6FoZaRjZiZ/iKoueSdrEkmGeacA= -github.com/tomarrell/wrapcheck/v2 v2.7.0/go.mod h1:ao7l5p0aOlUNJKI0qVwB4Yjlqutd0IvAB9Rdwyilxvg= -github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= -github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +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 v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= 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/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/ultraware/funlen v0.0.3 h1:5ylVWm8wsNwH5aWo9438pwvsK0QiqVuUrt9bn7S/iLA= -github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= -github.com/ultraware/whitespace v0.0.5 h1:hh+/cpIcopyMYbZNVov9iSxvJU3OYQg78Sfaqzi/CzI= -github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= 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/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN30b8= -github.com/uudashr/gocognit v1.0.6 h1:2Cgi6MweCsdB6kpcVQp7EW4U23iBFQWfTXiWlyp842Y= -github.com/uudashr/gocognit v1.0.6/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Uscky5BOwcY= -github.com/vbatts/tar-split v0.11.3 h1:hLFqsOLQ1SsppQNTMpkpPXClLDfC2A3Zgy9OUU+RVck= -github.com/vbatts/tar-split v0.11.3/go.mod h1:9QlHN18E+fEH7RdG+QAJJcuya3rqT7eXSTY7wGrAokY= +github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts= +github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk= 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/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= -github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= -github.com/yeya24/promlinter v0.2.0 h1:xFKDQ82orCU5jQujdaD8stOHiv8UN68BSdn2a8u8Y3o= -github.com/yeya24/promlinter v0.2.0/go.mod h1:u54lkmBOZrpEbQQ6gox2zWKKLKu2SGe+2KOiextY+IA= 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= -gitlab.com/bosi/decorder v0.2.3 h1:gX4/RgK16ijY8V+BRQHAySfQAb354T7/xQpDB2n10P0= -gitlab.com/bosi/decorder v0.2.3/go.mod h1:9K1RB5+VPNQYtXtTDAzd2OEftsZb1oV0IrJrzChSdGE= +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.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= +go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= 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= @@ -1317,31 +1138,47 @@ 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/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= -go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= -go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= -go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= -go.opentelemetry.io/otel/sdk v1.16.0 h1:Z1Ok1YsijYL0CSJpHt4cS3wDDh7p572grzNrBMiMWgE= -go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF9QD68aP6p4= -go.opentelemetry.io/otel/sdk/metric v0.39.0 h1:Kun8i1eYf48kHH83RucG93ffz0zGV1sh46FAScOTuDI= -go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= -go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 h1:Xw8U6u2f8DK2XAkGRFV7BBLENgnTGX9i4rQRxJf+/vs= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0/go.mod h1:6KW1Fm6R/s6Z3PGXwSJN2K4eT6wQB3vXX6CVnYX9NmM= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= +go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= +go.opentelemetry.io/otel/sdk/metric v1.19.0 h1:EJoTO5qysMsYCa+w4UghwFV/ptQgqSL/8Ni+hx+8i1k= +go.opentelemetry.io/otel/sdk/metric v1.19.0/go.mod h1:XjG0jQyFJrv2PbMvwND7LwCEhsJzCzV5210euduKcKY= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= +go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= 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/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= 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.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= 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= @@ -1350,15 +1187,11 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U 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-20191206172530-e9b2fee46413/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-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.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= 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= @@ -1370,11 +1203,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/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/exp/typeparams v0.0.0-20220827204233-334a2380cb91 h1:Ic/qN6TEifvObMGQy72k0n1LlJr7DjWWEi+MOsDOiSk= -golang.org/x/exp/typeparams v0.0.0-20220827204233-334a2380cb91/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= 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= @@ -1400,11 +1230,9 @@ 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.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +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= @@ -1446,16 +1274,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-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/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= @@ -1468,8 +1292,8 @@ 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.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= 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= @@ -1495,8 +1319,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.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= +golang.org/x/oauth2 v0.20.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= @@ -1511,8 +1335,8 @@ 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.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/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= @@ -1568,36 +1392,28 @@ 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-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-20210616045830-e2b7044e8c71/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-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-20211105183446-c75c47738b0c/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= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/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-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1611,23 +1427,21 @@ 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-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/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-20220906165534-d0df966e6959/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.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.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 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= -golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= 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= @@ -1637,29 +1451,24 @@ 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.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= 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.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-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-20190307163923-6a08e3108db3/go.mod h1:25r3+/G6/xytQM8iWZKq3Hn0kr0rgFKPUNVEL/dr3z4= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/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-20190321232350-e250d351ecad/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/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= @@ -1668,9 +1477,7 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw 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-20190910044552-dd2b5c81c578/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-20190916130336-e45ffcd953cc/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= @@ -1684,7 +1491,6 @@ golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapK 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-20200117220505-0cba7a3a9ee9/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= @@ -1694,51 +1500,30 @@ golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapK 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-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 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-20200622203043-20e05c1c8ffa/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200624225443-88f3c62a19ff/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200625211823-6506e20df31f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 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-20200812195022-5ae4c3c160a0/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200831203904-5a2aa26beb65/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201001104356-43ebab892c4c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201002184944-ecd9fd270d5d/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 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-20201230224404-63754364767c/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-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= -golang.org/x/tools v0.1.1-0.20210302220138-2ac05c832e1a/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= 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-0.20211228192929-ee1ca4ffc4da/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg= -golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= +golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= +golang.org/x/tools v0.21.0/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= @@ -1746,8 +1531,9 @@ 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= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= 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= @@ -1797,8 +1583,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.171.0 h1:w174hnBPqut76FzW5Qaupt7zY8Kql6fiVjgys4f58sU= +google.golang.org/api v0.171.0/go.mod h1:Hnq5AHm4OTMt2BUVjael2CWZFD6vksJdWCWiUAmjC9o= 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= @@ -1806,7 +1592,6 @@ 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-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -1846,10 +1631,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= @@ -1916,8 +1699,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-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +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-20240515191416-fc5f0ca64291 h1:4HZJ3Xv1cmrJ+0aFo304Zn79ur1HMxptAE7aCPNLSqc= +google.golang.org/genproto/googleapis/api v0.0.0-20240515191416-fc5f0ca64291/go.mod h1:RGnPtTG7r4i8sPlNyDeikXF99hMM+hN6QMm4ooG9g2g= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 h1:AgADTJarZTBqgjiUzRgfaBchgYB3/WFTC80GPwsMcRI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= 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= @@ -1959,10 +1746,11 @@ 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/cmd/protoc-gen-go-grpc v1.1.0 h1:M1YKkFIboKNieVO5DLUEVzQfGwJD30Nv2jfUgzb5UcE= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 h1:rNBFJjBCOgVr9pWD7rs/knKL4FRTKgpZmsRfV214zcA= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0/go.mod h1:Dk1tviKTvMCz5tvh7t+fh94dhmQVHuCt2OzJB3CTW9Y= 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= @@ -1978,15 +1766,16 @@ 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= 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-20200227125254-8fa46927fb4f/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= @@ -2012,8 +1801,8 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +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= @@ -2022,24 +1811,16 @@ 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.3.3 h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA= -honnef.co/go/tools v0.3.3/go.mod h1:jzwdWgg7Jdq75wlfblQxO4neNaFFSvgc1tD5Wv8U0Yw= mvdan.cc/gofumpt v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM= mvdan.cc/gofumpt v0.4.0/go.mod h1:PljLOHDeZqgS8opHRKLzp2It2VBuSdteAgqUfzMTxlQ= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= -mvdan.cc/unparam v0.0.0-20220706161116-678bad134442 h1:seuXWbRB1qPrS3NQnHmFKLJLtskWyueeIzmLXghMGgk= -mvdan.cc/unparam v0.0.0-20220706161116-678bad134442/go.mod h1:F/Cxw/6mVrNKqrR2YjFf5CaW0Bw4RL8RfbEf4GRggJk= 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.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= -pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +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/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/proto/buf.gen.pulsar.yaml b/proto/buf.gen.pulsar.yaml index e8fffdb2..01c378b7 100644 --- a/proto/buf.gen.pulsar.yaml +++ b/proto/buf.gen.pulsar.yaml @@ -7,12 +7,13 @@ version: v1 managed: enabled: true go_package_prefix: - default: cosmossdk.io/api + default: github.com/tendermint/fundraising/api except: - buf.build/googleapis/googleapis - buf.build/cosmos/gogo-proto - buf.build/cosmos/cosmos-proto override: + buf.build/cosmos/cosmos-sdk: cosmossdk.io/api plugins: - name: go-pulsar out: ./api diff --git a/proto/buf.gen.swagger.yaml b/proto/buf.gen.swagger.yaml index 2eafa902..58d30d86 100644 --- a/proto/buf.gen.swagger.yaml +++ b/proto/buf.gen.swagger.yaml @@ -10,5 +10,5 @@ plugins: opt: - logtostderr=true - openapi_naming_strategy=fqn - - simple_operation_ids=true - json_names_for_fields=false + - generate_unbound_methods=true \ No newline at end of file diff --git a/proto/buf.lock b/proto/buf.lock index 77287f75..5648aed4 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -1,31 +1,43 @@ -# This file is auto-generated from Ignite. -# DO NOT EDIT -# -# buf.lock -# +# Generated by buf. DO NOT EDIT. version: v1 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: 954f7b05f38440fc8250134b15adec47 + commit: 05419252bcc241ea8023acf1ed4cadc5 + digest: shake256:1e54a48c19a8b59d35e0a7efa76402939f515f2d8005df099856f24c37c20a52800308f025abb8cffcd014d437b49707388aaca4865d9d063d8f25d5d4eb77d5 - remote: buf.build owner: cosmos repository: gogo-proto - commit: 34d970b699f84aa382f3c29773a60836 + commit: 88ef6483f90f478fb938c37dde52ece3 + digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba + - remote: buf.build + owner: cosmos + repository: ibc + commit: c159402ffeef4c21a7f9f0643817ae0d + digest: shake256:694e3f5a1d469798bb6cb3510f6f489e10d9309d1f2e8f7a369a776947602195f13ab65972d2d586a1134978b6a6fa28a43e5d7710ef5032ba0c7fbbe6038f08 - remote: buf.build owner: cosmos repository: ics23 - commit: 3c44d8daa8b44059ac744cd17d4a49d7 + commit: a9ee7c290ef34ee69d3f141b9b44dcee + digest: shake256:255dbee3e92a370723bf4d72b34868b18e7570543f30f79c0c8c10a5a332d230175e0c29cb7ebcb8020706312e3cd37c23974df0bacfb60a4afb968fee4c1afc - remote: buf.build owner: googleapis repository: googleapis - commit: 75b4300737fb4efca0831636be94e517 + commit: 8bc2c51e08c447cd8886cdea48a73e14 + digest: shake256:a969155953a5cedc5b2df5b42c368f2bc66ff8ce1804bc96e0f14ff2ee8a893687963058909df844d1643cdbc98ff099d2daa6bc9f9f5b8886c49afdc60e19af - remote: buf.build owner: protocolbuffers repository: wellknowntypes - commit: 44e83bc050a4497fa7b36b34d95ca156 + commit: ee20af7d5b6044139bb9051283720274 + digest: shake256:030e02269b2b3c080f716a133798cdaf2ca847192c63303cae27e996a26a0e433d0845c14063023ef98bf5750d0884987bc07b8babe903163d07ecbc3a30adb7 + - remote: buf.build + owner: tendermint + repository: tendermint + commit: 33ed361a90514289beabf3189e1d7665 + digest: shake256:038267e06294714fd883610626554b04a127b576b4e253befb4206cb72d5d3c1eeccacd4b9ec8e3fb891f7c14e1cb0f770c077d2989638995b0a61c85afedb1d diff --git a/proto/buf.yaml b/proto/buf.yaml index 7a86adcf..0cf8f44b 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -1,29 +1,25 @@ -# This file is auto-generated from Ignite. You can edit -# the file content but do not change the file name or path. -# -# buf.yaml -# -version: v1 -deps: - - buf.build/protocolbuffers/wellknowntypes - - buf.build/cosmos/cosmos-sdk - - buf.build/cosmos/cosmos-proto - - buf.build/cosmos/gogo-proto - - buf.build/googleapis/googleapis - - buf.build/cosmos/ics23 breaking: - use: - - FILE + use: + - FILE +deps: + - buf.build/protocolbuffers/wellknowntypes + - buf.build/cosmos/cosmos-sdk + - buf.build/cosmos/cosmos-proto + - buf.build/cosmos/gogo-proto + - buf.build/googleapis/googleapis + - buf.build/cosmos/ics23 + - buf.build/cosmos/ibc lint: - use: - - DEFAULT - - COMMENTS - - FILE_LOWER_SNAKE_CASE - except: - - UNARY_RPC - - COMMENT_FIELD - - SERVICE_SUFFIX - - PACKAGE_VERSION_SUFFIX - - RPC_REQUEST_STANDARD_NAME - ignore: - - tendermint + except: + - UNARY_RPC + - COMMENT_FIELD + - SERVICE_SUFFIX + - PACKAGE_VERSION_SUFFIX + - RPC_REQUEST_STANDARD_NAME + ignore: + - tendermint + use: + - DEFAULT + - COMMENTS + - FILE_LOWER_SNAKE_CASE +version: v1 diff --git a/proto/fundraising/fundraising/module/v1/module.proto b/proto/fundraising/fundraising/module/v1/module.proto new file mode 100644 index 00000000..9f5c430c --- /dev/null +++ b/proto/fundraising/fundraising/module/v1/module.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package fundraising.fundraising.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object for the module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/tendermint/fundraising/x/fundraising" + }; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 1; + + +} \ No newline at end of file diff --git a/proto/fundraising/fundraising/v1/allowed_bidder.proto b/proto/fundraising/fundraising/v1/allowed_bidder.proto new file mode 100644 index 00000000..a6eda7bb --- /dev/null +++ b/proto/fundraising/fundraising/v1/allowed_bidder.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package fundraising.fundraising.v1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/tendermint/fundraising/x/fundraising/types"; + +// AllowedBidder defines an allowed bidder for the auction. +message AllowedBidder { + option (gogoproto.goproto_getters) = false; + + // auction_id specifies the id of the auction + uint64 auction_id = 1; + + // bidder specifies the bech32-encoded address that bids for the auction + string bidder = 2; + + // max_bid_amount specifies the maximum bid amount that the bidder can bid + string max_bid_amount = 3 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (cosmos_proto.scalar) = "cosmos.Int" + ]; +} diff --git a/proto/fundraising/fundraising.proto b/proto/fundraising/fundraising/v1/auction.proto similarity index 51% rename from proto/fundraising/fundraising.proto rename to proto/fundraising/fundraising/v1/auction.proto index 487dd8b2..98406db0 100644 --- a/proto/fundraising/fundraising.proto +++ b/proto/fundraising/fundraising/v1/auction.proto @@ -1,9 +1,10 @@ syntax = "proto3"; -package fundraising; +package fundraising.fundraising.v1; +import "amino/amino.proto"; import "cosmos/base/v1beta1/coin.proto"; -import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; option go_package = "github.com/tendermint/fundraising/x/fundraising/types"; @@ -37,12 +38,19 @@ message BaseAuction { // start_price specifies the starting price of the auction // it is determined by the proportion of the price of paying coin denom - string start_price = 6 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string start_price = 6 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; // selling_coin specifies the selling coin for the auction - cosmos.base.v1beta1.Coin selling_coin = 7 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; + cosmos.base.v1beta1.Coin selling_coin = 7 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; // paying_coin_denom specifies the paying coin denom that bidders use to bid // for @@ -56,10 +64,16 @@ message BaseAuction { repeated VestingSchedule vesting_schedules = 10 [(gogoproto.nullable) = false]; // start_time specifies the start time of the plan - google.protobuf.Timestamp start_time = 11 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp start_time = 11 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; // end_times specifies the end time of the plan - repeated google.protobuf.Timestamp end_times = 12 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + repeated google.protobuf.Timestamp end_times = 12 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; // status specifies the auction status AuctionStatus status = 13; @@ -74,8 +88,10 @@ message FixedPriceAuction { BaseAuction base_auction = 1 [(gogoproto.embed) = true]; // remaining_coin specifies the remaining amount of selling coin to sell - cosmos.base.v1beta1.Coin remaining_selling_coin = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; + cosmos.base.v1beta1.Coin remaining_selling_coin = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; } // BatchAuction defines a batch auction type. It allows bidders to participate @@ -90,20 +106,29 @@ message BatchAuction { BaseAuction base_auction = 1 [(gogoproto.embed) = true]; // min_bid_price specifies the minibum bid price - string min_bid_price = 2 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string min_bid_price = 2 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; // matched_price specifies the matched price of the auction - string matched_price = 3 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string matched_price = 3 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; // max_extended_round specifies a maximum number of extended rounds uint32 max_extended_round = 4; // extended_round_rate specifies the rate that decides if the auction needs // another round - string extended_round_rate = 5 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string extended_round_rate = 5 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; } // AuctionType enumerates the valid types of an auction. @@ -139,100 +164,15 @@ enum AuctionStatus { // VestingSchedule defines the vesting schedule for the owner of an auction. message VestingSchedule { // release_time specifies the time for distribution of the vesting coin - google.protobuf.Timestamp release_time = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp release_time = 1 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; // weight specifies the vesting weight for the schedule - string weight = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; -} - -// VestingQueue defines the vesting queue. -message VestingQueue { - // auction_id specifies the id of the auction - uint64 auction_id = 1; - - // auctioneer specifies the bech32-encoded address that creates the auction - string auctioneer = 2; - - // paying_coin specifies the paying amount of coin - cosmos.base.v1beta1.Coin paying_coin = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; - - // release_time specifies the timestamp of the vesting schedule - google.protobuf.Timestamp release_time = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - - // released specifies the status of distribution - bool released = 5; -} - -// AllowedBidder defines an allowed bidder for the auction. -message AllowedBidder { - option (gogoproto.goproto_getters) = false; - - // bidder specifies the bech32-encoded address that bids for the auction - string bidder = 1; - - // max_bid_amount specifies the maximum bid amount that the bidder can bid - string max_bid_amount = 2 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; -} - -// Bid defines a standard bid for an auction. -message Bid { - option (gogoproto.goproto_getters) = false; - - // auction_id specifies the id of the auction - uint64 auction_id = 1; - - // bidder specifies the bech32-encoded address that bids for the auction - string bidder = 2; - - // id specifies an index of a bid for the bidder - uint64 id = 3; - - // type specifies the bid type; type 1 is fixed price, 2 is how-much-worth, 3 - // is how-many-coins - BidType type = 4; - - // price specifies the bid price in which price the bidder places the bid - string price = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; - - // coin specifies the amount of coin that the bidder bids - // for a fixed price auction, the denom is of the paying coin. - // for a batch auction of how-much-worth, the denom is of the paying coin. - // for a batch auction of how-many-coins, the denom is of the selling coin. - cosmos.base.v1beta1.Coin coin = 6 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; - - // is_matched specifies the bid that is a winning bid and enables the bidder - // to purchase the selling coin - bool is_matched = 7; + string weight = 2 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; } - -// BidType enumerates the valid types of a bid. -enum BidType { - option (gogoproto.goproto_enum_prefix) = false; - - // BID_TYPE_UNSPECIFIED defines the default bid type - BID_TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "BidTypeNil"]; - - // BID_TYPE_FIXED_PRICE defines a bid type for a fixed price auction type - BID_TYPE_FIXED_PRICE = 1 [(gogoproto.enumvalue_customname) = "BidTypeFixedPrice"]; - - // BID_TYPE_BATCH_WORTH defines a bid type for How-Much-Worth-to-Buy of a - // batch auction - BID_TYPE_BATCH_WORTH = 2 [(gogoproto.enumvalue_customname) = "BidTypeBatchWorth"]; - - // BID_TYPE_BATCH_MANY defines a bid type for How-Many-Coins-to-Buy of a batch - // auction - BID_TYPE_BATCH_MANY = 3 [(gogoproto.enumvalue_customname) = "BidTypeBatchMany"]; -} - -// AddressType enumerates the available types of a address. -enum AddressType { - option (gogoproto.goproto_enum_prefix) = false; - - // the 32 bytes length address type of ADR 028. - ADDRESS_TYPE_32_BYTES = 0 [(gogoproto.enumvalue_customname) = "AddressType32Bytes"]; - // the default 20 bytes length address type. - ADDRESS_TYPE_20_BYTES = 1 [(gogoproto.enumvalue_customname) = "AddressType20Bytes"]; -} \ No newline at end of file diff --git a/proto/fundraising/fundraising/v1/bid.proto b/proto/fundraising/fundraising/v1/bid.proto new file mode 100644 index 00000000..d5fe2125 --- /dev/null +++ b/proto/fundraising/fundraising/v1/bid.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; +package fundraising.fundraising.v1; + +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/tendermint/fundraising/x/fundraising/types"; + +// Bid defines a standard bid for an auction. +message Bid { + option (gogoproto.goproto_getters) = false; + + // auction_id specifies the id of the auction + uint64 auction_id = 1; + + // bidder specifies the bech32-encoded address that bids for the auction + string bidder = 2; + + // id specifies an index of a bid for the bidder + uint64 id = 3; + + // type specifies the bid type; type 1 is fixed price, 2 is how-much-worth, 3 + // is how-many-coins + BidType type = 4; + + // price specifies the bid price in which price the bidder places the bid + string price = 5 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; + + // coin specifies the amount of coin that the bidder bids + // for a fixed price auction, the denom is of the paying coin. + // for a batch auction of how-much-worth, the denom is of the paying coin. + // for a batch auction of how-many-coins, the denom is of the selling coin. + cosmos.base.v1beta1.Coin coin = 6 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + + // is_matched specifies the bid that is a winning bid and enables the bidder + // to purchase the selling coin + bool is_matched = 7; +} + +// BidType enumerates the valid types of a bid. +enum BidType { + option (gogoproto.goproto_enum_prefix) = false; + + // BID_TYPE_UNSPECIFIED defines the default bid type + BID_TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "BidTypeNil"]; + + // BID_TYPE_FIXED_PRICE defines a bid type for a fixed price auction type + BID_TYPE_FIXED_PRICE = 1 [(gogoproto.enumvalue_customname) = "BidTypeFixedPrice"]; + + // BID_TYPE_BATCH_WORTH defines a bid type for How-Much-Worth-to-Buy of a + // batch auction + BID_TYPE_BATCH_WORTH = 2 [(gogoproto.enumvalue_customname) = "BidTypeBatchWorth"]; + + // BID_TYPE_BATCH_MANY defines a bid type for How-Many-Coins-to-Buy of a batch + // auction + BID_TYPE_BATCH_MANY = 3 [(gogoproto.enumvalue_customname) = "BidTypeBatchMany"]; +} + +// AddressType enumerates the available types of a address. +enum AddressType { + option (gogoproto.goproto_enum_prefix) = false; + + // the 32 bytes length address type of ADR 028. + ADDRESS_TYPE_32_BYTES = 0 [(gogoproto.enumvalue_customname) = "AddressType32Bytes"]; + // the default 20 bytes length address type. + ADDRESS_TYPE_20_BYTES = 1 [(gogoproto.enumvalue_customname) = "AddressType20Bytes"]; +} diff --git a/proto/fundraising/fundraising/v1/genesis.proto b/proto/fundraising/fundraising/v1/genesis.proto new file mode 100644 index 00000000..ebca9165 --- /dev/null +++ b/proto/fundraising/fundraising/v1/genesis.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; + +package fundraising.fundraising.v1; + +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; +import "fundraising/fundraising/v1/allowed_bidder.proto"; +import "fundraising/fundraising/v1/auction.proto"; +import "fundraising/fundraising/v1/bid.proto"; +import "fundraising/fundraising/v1/params.proto"; +import "fundraising/fundraising/v1/vesting_queue.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/tendermint/fundraising/x/fundraising/types"; + +// GenesisState defines the fundraising module's genesis state. +message GenesisState { + // params defines all the parameters of the module. + Params params = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + + // auctionList define the auction interface for genesis state; the module + // supports FixedPriceAuction or BatchAuction + repeated google.protobuf.Any auctionList = 2 [(cosmos_proto.accepts_interface) = "AuctionI"]; + + // allowedBidderList define the allowed bidder records for the auction + repeated AllowedBidder allowedBidderList = 3 [(gogoproto.nullable) = false]; + + // bidList define the bid records used for genesis state + repeated Bid bidList = 4 [(gogoproto.nullable) = false]; + + // vestingQueueList define the vesting queue records used for genesis state + repeated VestingQueue vestingQueueList = 5 [(gogoproto.nullable) = false]; +} diff --git a/proto/fundraising/params.proto b/proto/fundraising/fundraising/v1/params.proto similarity index 65% rename from proto/fundraising/params.proto rename to proto/fundraising/fundraising/v1/params.proto index 00e57335..b0e123c5 100644 --- a/proto/fundraising/params.proto +++ b/proto/fundraising/fundraising/v1/params.proto @@ -1,36 +1,40 @@ syntax = "proto3"; -package fundraising; +package fundraising.fundraising.v1; + +import "amino/amino.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/tendermint/fundraising/x/fundraising/types"; -// Params defines the set of params for the fundraising module. +// Params defines the parameters for the module. message Params { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option (amino.name) = "fundraising/x/fundraising/Params"; + option (gogoproto.equal) = true; // auction_creation_fee specifies the fee for auction creation. // this prevents from spamming attack and it is collected in the community // pool repeated cosmos.base.v1beta1.Coin auction_creation_fee = 1 [ - (gogoproto.moretags) = "yaml:\"auction_creation_fee\"", - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.nullable) = false + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; // place_bid_fee specifies the fee for placing a bid for an auction. // this prevents from spamming attack and it is collected in the community // pool repeated cosmos.base.v1beta1.Coin place_bid_fee = 2 [ - (gogoproto.moretags) = "yaml:\"place_bid_fee\"", - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.nullable) = false + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; // extended_period specifies the extended period that determines how long // the extended auction round lasts - uint32 extended_period = 3 [(gogoproto.moretags) = "yaml:\"extended_period\""]; + uint32 extended_period = 3; } diff --git a/proto/fundraising/fundraising/v1/query.proto b/proto/fundraising/fundraising/v1/query.proto new file mode 100644 index 00000000..9d971340 --- /dev/null +++ b/proto/fundraising/fundraising/v1/query.proto @@ -0,0 +1,164 @@ +syntax = "proto3"; + +package fundraising.fundraising.v1; + +import "amino/amino.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos_proto/cosmos.proto"; +import "fundraising/fundraising/v1/allowed_bidder.proto"; +import "fundraising/fundraising/v1/auction.proto"; +import "fundraising/fundraising/v1/bid.proto"; +import "fundraising/fundraising/v1/params.proto"; +import "fundraising/fundraising/v1/vesting_queue.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/tendermint/fundraising/x/fundraising/types"; + +// Query defines the gRPC querier service. +service Query { + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/tendermint/fundraising/fundraising/v1/params"; + } + + // Queries a list of Auction items. + rpc ListAuction(QueryAllAuctionRequest) returns (QueryAllAuctionResponse) { + option (google.api.http).get = "/tendermint/fundraising/fundraising/auction"; + } + rpc GetAuction(QueryGetAuctionRequest) returns (QueryGetAuctionResponse) { + option (google.api.http).get = "/tendermint/fundraising/fundraising/auction/{auction_id}"; + } + + // Queries a list of AllowedBidder items. + rpc ListAllowedBidder(QueryAllAllowedBidderRequest) returns (QueryAllAllowedBidderResponse) { + option (google.api.http).get = "/tendermint/fundraising/fundraising/auction/{auction_id}/allowed_bidder"; + } + rpc GetAllowedBidder(QueryGetAllowedBidderRequest) returns (QueryGetAllowedBidderResponse) { + option (google.api.http).get = "/tendermint/fundraising/fundraising/auction/{auction_id}/allowed_bidder/{bidder}"; + } + + // Queries a list of Bid items. + rpc ListBid(QueryAllBidRequest) returns (QueryAllBidResponse) { + option (google.api.http).get = "/tendermint/fundraising/fundraising/auction/{auction_id}/bid"; + } + rpc GetBid(QueryGetBidRequest) returns (QueryGetBidResponse) { + option (google.api.http).get = "/tendermint/fundraising/fundraising/auction/{auction_id}/bid/{bid_id}"; + } + + // Queries a list of VestingQueue items. + rpc ListVestingQueue(QueryAllVestingQueueRequest) returns (QueryAllVestingQueueResponse) { + option (google.api.http).get = "/tendermint/fundraising/fundraising/auction/{auction_id}/vestings"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// QueryAllAuctionRequest is request type for the Query/Auctions RPC method. +message QueryAllAuctionRequest { + string status = 1; + string type = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryAllAuctionResponse is response type for the Query/Auctions RPC method. +message QueryAllAuctionResponse { + // auctions specifies the existing auctions + repeated google.protobuf.Any auction = 1 [(cosmos_proto.accepts_interface) = "AuctionI"]; + + // pagination defines the pagination in the response + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGetAuctionRequest is the request type for the Query/Auction RPC method. +message QueryGetAuctionRequest { + uint64 auction_id = 1; +} + +// QueryGetAuctionResponse is the response type for the Query/Auction RPC method. +message QueryGetAuctionResponse { + google.protobuf.Any auction = 1 [(cosmos_proto.accepts_interface) = "AuctionI"]; +} + +// QueryAllowedBidderRequest is the request type for the Query/AllowedBidder RPC method. +message QueryAllAllowedBidderRequest { + uint64 auction_id = 1; + + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryAllowedBidderResponse is the response type for the Query/AllowedBidder RPC method. +message QueryAllAllowedBidderResponse { + repeated AllowedBidder allowed_bidder = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryAllowedBidderRequest is the request type for the Query/AllowedBidder RPC +// method. +message QueryGetAllowedBidderRequest { + uint64 auction_id = 1; + string bidder = 2; +} + +// QueryAllowedBidderResponse is the response type for the Query/AllowedBidder +// RPC method. +message QueryGetAllowedBidderResponse { + AllowedBidder allowed_bidder = 1 [(gogoproto.nullable) = false]; +} + +// QueryGetBidRequest is the request type for the Query/Sequence RPC method. +message QueryGetBidRequest { + uint64 auction_id = 1; + uint64 bid_id = 2; +} + +// QueryGetBidResponse is response type for the Query/Sequence RPC method. +message QueryGetBidResponse { + // bid specifies specific bid + Bid bid = 1 [(gogoproto.nullable) = false]; +} + +// QueryBidsRequest is request type for the Query/Bids RPC method. +message QueryAllBidRequest { + uint64 auction_id = 1; + string bidder = 2; + string is_matched = 3; + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryBidsResponse is response type for the Query/Bids RPC method. +message QueryAllBidResponse { + // bids specifies the existing bids + repeated Bid bid = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryAllVestingQueueRequest is request type for the Query/Vestings RPC method. +message QueryAllVestingQueueRequest { + uint64 auction_id = 1; + + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryAllVestingQueueResponse is response type for the Query/Vestings RPC method. +message QueryAllVestingQueueResponse { + // vestings specifies the existing vestings + repeated VestingQueue vestingQueue = 1 [(gogoproto.nullable) = false]; + + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/fundraising/tx.proto b/proto/fundraising/fundraising/v1/tx.proto similarity index 55% rename from proto/fundraising/tx.proto rename to proto/fundraising/fundraising/v1/tx.proto index a93e0e13..ce4fb9f0 100644 --- a/proto/fundraising/tx.proto +++ b/proto/fundraising/fundraising/v1/tx.proto @@ -1,20 +1,32 @@ syntax = "proto3"; -package fundraising; +package fundraising.fundraising.v1; + +import "amino/amino.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "fundraising/fundraising/v1/allowed_bidder.proto"; +import "fundraising/fundraising/v1/auction.proto"; +import "fundraising/fundraising/v1/bid.proto"; +import "fundraising/fundraising/v1/params.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; -import "fundraising/fundraising.proto"; option go_package = "github.com/tendermint/fundraising/x/fundraising/types"; // Msg defines the Msg service. service Msg { - // this line is used by Starport scaffolding # proto/tx/rpc - // Submit a create fixed price auction message. + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // CreateFixedPriceAuction submits a create fixed price auction message. rpc CreateFixedPriceAuction(MsgCreateFixedPriceAuction) returns (MsgCreateFixedPriceAuctionResponse); - // Submit a create batch auction message. + // CreateBatchAuction submits a create batch auction message. rpc CreateBatchAuction(MsgCreateBatchAuction) returns (MsgCreateBatchAuctionResponse); // CancelAuction defines a method to cancel the auction message. @@ -31,21 +43,49 @@ service Msg { rpc AddAllowedBidder(MsgAddAllowedBidder) returns (MsgAddAllowedBidderResponse); } +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "fundraising/x/fundraising/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the module parameters to update. + + // NOTE: All parameters must be supplied. + Params params = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +message MsgUpdateParamsResponse {} + // MsgCreateFixedPriceAuction defines a SDK message for creating a fixed price // auction. message MsgCreateFixedPriceAuction { - option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "auctioneer"; // auctioneer specifies the bech32-encoded address that creates the auction string auctioneer = 1; // start_price specifies the starting price of the auction - string start_price = 2 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string start_price = 2 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; // selling_coin specifies the selling coin for the auction - cosmos.base.v1beta1.Coin selling_coin = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; + cosmos.base.v1beta1.Coin selling_coin = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; // paying_coin_denom specifies the paying coin denom that bidders use to bid // for @@ -55,10 +95,16 @@ message MsgCreateFixedPriceAuction { repeated VestingSchedule vesting_schedules = 5 [(gogoproto.nullable) = false]; // start_time specifies the start time of the plan - google.protobuf.Timestamp start_time = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp start_time = 6 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; // end_time specifies the end time of the plan - google.protobuf.Timestamp end_time = 7 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp end_time = 7 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; } // MsgCreateFixedPriceAuctionResponse defines the @@ -71,22 +117,32 @@ message MsgCreateFixedPriceAuctionResponse {} // See: // https://github.com/tendermint/fundraising/tree/main/x/fundraising/spec/04_messages.md message MsgCreateBatchAuction { - option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "auctioneer"; // auctioneer specifies the bech32-encoded address that creates the auction string auctioneer = 1; // start_price specifies the starting price of the auction - string start_price = 2 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string start_price = 2 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; // min_bid_price specifies the minibum bid price - string min_bid_price = 3 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string min_bid_price = 3 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; // selling_coin specifies the selling coin for the auction - cosmos.base.v1beta1.Coin selling_coin = 4 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin", (gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin selling_coin = 4 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; // paying_coin_denom specifies the paying coin denom that bidders use to bid // for @@ -101,14 +157,23 @@ message MsgCreateBatchAuction { // extended_round_rate specifies the rate that decides if the auction needs // another round - string extended_round_rate = 8 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string extended_round_rate = 8 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; // start_time specifies the start time of the plan - google.protobuf.Timestamp start_time = 9 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp start_time = 9 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; // end_time specifies the end time of the plan - google.protobuf.Timestamp end_time = 10 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp end_time = 10 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; } // MsgCreateBatchAuctionResponse defines the @@ -118,7 +183,7 @@ message MsgCreateBatchAuctionResponse {} // MsgCancelAuction defines a SDK message for cancelling the auction. // Cancelling is only allowed when the auction hasn't started yet. message MsgCancelAuction { - option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "auctioneer"; // auctioneer specifies the bech32-encoded address that is in charge of the // auction @@ -133,8 +198,8 @@ message MsgCancelAuction { message MsgCancelAuctionResponse {} // MsgPlaceBid defines a SDK message for placing a bid for the auction. -message MsgPlaceBid {// id specifies index of the auction - option (gogoproto.goproto_getters) = false; +message MsgPlaceBid { + option (cosmos.msg.v1.signer) = "bidder"; // auction_id specifies the auction id uint64 auction_id = 1; @@ -149,12 +214,20 @@ message MsgPlaceBid {// id specifies index of the auction // price specifies the bid price. // The bid price must be the start price for fixed price auction whereas // the bide price can be any value that the bidder places. - string price = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string price = 4 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; // coin specifies the paying amount of coin or the selling amount that the // bidder bids - cosmos.base.v1beta1.Coin coin = 5 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin", (gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin coin = 5 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; } // MsgPlaceBidResponse defines the Msg/MsgPlaceBidResponse response type. @@ -162,8 +235,8 @@ message MsgPlaceBidResponse {} // MsgModifyBid defines a SDK message for modifying an existing bid for the // auction. -message MsgModifyBid {// id specifies index of the auction - option (gogoproto.goproto_getters) = false; +message MsgModifyBid { + option (cosmos.msg.v1.signer) = "bidder"; // auction_id specifies the auction id uint64 auction_id = 1; @@ -177,12 +250,20 @@ message MsgModifyBid {// id specifies index of the auction // price specifies the bid price. // the bide price must be above or equal to the original value that the bidder // placed. - string price = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string price = 4 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; // coin specifies the paying amount of coin or the selling amount that the // bidder bids - cosmos.base.v1beta1.Coin coin = 5 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin", (gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin coin = 5 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; } // MsgModifyBidResponse defines the Msg/MsgModifyBidResponse response type. @@ -191,7 +272,7 @@ message MsgModifyBidResponse {} // MsgAddAllowedBidder defines a SDK message for adding an allowed bidder to the // auction. message MsgAddAllowedBidder { - option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "allowed_bidder.bidder"; // auction_id specifies the auction id uint64 auction_id = 1; @@ -201,4 +282,5 @@ message MsgAddAllowedBidder { AllowedBidder allowed_bidder = 2 [(gogoproto.nullable) = false]; } -message MsgAddAllowedBidderResponse {} \ No newline at end of file +// MsgAddAllowedBidderResponse defines the Msg/MsgAddAllowedBidderResponse response type. +message MsgAddAllowedBidderResponse {} diff --git a/proto/fundraising/fundraising/v1/vesting_queue.proto b/proto/fundraising/fundraising/v1/vesting_queue.proto new file mode 100644 index 00000000..35b58962 --- /dev/null +++ b/proto/fundraising/fundraising/v1/vesting_queue.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; +package fundraising.fundraising.v1; + +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/tendermint/fundraising/x/fundraising/types"; + +// VestingQueue defines the vesting queue. +message VestingQueue { + // auction_id specifies the id of the auction + uint64 auction_id = 1; + + // auctioneer specifies the bech32-encoded address that creates the auction + string auctioneer = 2; + + // paying_coin specifies the paying amount of coin + cosmos.base.v1beta1.Coin paying_coin = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + + // release_time specifies the timestamp of the vesting schedule + google.protobuf.Timestamp release_time = 4 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + + // released specifies the status of distribution + bool released = 5; +} diff --git a/proto/fundraising/genesis.proto b/proto/fundraising/genesis.proto deleted file mode 100644 index 9dbe43b0..00000000 --- a/proto/fundraising/genesis.proto +++ /dev/null @@ -1,41 +0,0 @@ -syntax = "proto3"; -package fundraising; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "fundraising/fundraising.proto"; -import "fundraising/params.proto"; - -option go_package = "github.com/tendermint/fundraising/x/fundraising/types"; - -// GenesisState defines the fundraising module's genesis state. -message GenesisState { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // params defines all the parameters for the module - Params params = 1 [(gogoproto.nullable) = false]; - - // auctions define the auction interface for genesis state; the module - // supports FixedPriceAuction or BatchAuction - repeated google.protobuf.Any auctions = 2 [(cosmos_proto.accepts_interface) = "AuctionI"]; - - // allowed_bidder_records define the allowed bidder records for the auction - repeated AllowedBidderRecord allowed_bidder_records = 3 [(gogoproto.nullable) = false]; - - // bids define the bid records used for genesis state - repeated Bid bids = 4 [(gogoproto.nullable) = false]; - - // vesting_queues define the vesting queue records used for genesis - // state - repeated VestingQueue vesting_queues = 5 [(gogoproto.nullable) = false]; -} - -message AllowedBidderRecord { - // auction_ id specifies index of the auction - uint64 auction_id = 1; - - // allowed_bidder specifies allowed bidder for the auction - AllowedBidder allowed_bidder = 2 [(gogoproto.nullable) = false]; -} \ No newline at end of file diff --git a/proto/fundraising/query.proto b/proto/fundraising/query.proto deleted file mode 100644 index a30241d6..00000000 --- a/proto/fundraising/query.proto +++ /dev/null @@ -1,161 +0,0 @@ -syntax = "proto3"; -package fundraising; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; -import "fundraising/fundraising.proto"; -import "fundraising/params.proto"; - -option go_package = "github.com/tendermint/fundraising/x/fundraising/types"; - -// Query defines the gRPC querier service. -service Query { - // Params returns parameters of the fundraising module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/fundraising/v1beta1/params"; - } - - // Auctions returns all auctions. - rpc Auctions(QueryAuctionsRequest) returns (QueryAuctionsResponse) { - option (google.api.http).get = "/cosmos/fundraising/v1beta1/auctions"; - } - - // Auction returns the specific auction. - rpc Auction(QueryAuctionRequest) returns (QueryAuctionResponse) { - option (google.api.http).get = "/cosmos/fundraising/v1beta1/auctions/{auction_id}"; - } - - // AllowedBidder returns the specific allowed bidder information. - rpc AllowedBidder(QueryAllowedBidderRequest) returns (QueryAllowedBidderResponse) { - option (google.api.http).get = "/cosmos/fundraising/v1beta1/auctions/" - "{auction_id}/allowed_bidders/{bidder}"; - } - - // AllowedBidders returns all allowed bidders for the auction. - rpc AllowedBidders(QueryAllowedBiddersRequest) returns (QueryAllowedBiddersResponse) { - option (google.api.http).get = "/cosmos/fundraising/v1beta1/auctions/{auction_id}/allowed_bidders"; - } - - // Bids returns all bids. - rpc Bids(QueryBidsRequest) returns (QueryBidsResponse) { - option (google.api.http).get = "/cosmos/fundraising/v1beta1/auctions/{auction_id}/bids"; - } - - // Bid returns the specific bid from the auction id and bid id. - rpc Bid(QueryBidRequest) returns (QueryBidResponse) { - option (google.api.http).get = "/cosmos/fundraising/v1beta1/auctions/{auction_id}/bids/{bid_id}"; - } - - // Vestings returns all vestings for the auction. - rpc Vestings(QueryVestingsRequest) returns (QueryVestingsResponse) { - option (google.api.http).get = "/cosmos/fundraising/v1beta1/auctions/{auction_id}/vestings"; - } -} - -// QueryParamsRequest is request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is response type for the Query/Params RPC method. -message QueryParamsResponse { - // params holds all the parameters of this module. - Params params = 1 [(gogoproto.nullable) = false]; -} - -// QueryAuctionsRequest is request type for the Query/Auctions RPC method. -message QueryAuctionsRequest { - string status = 1; - string type = 2; - cosmos.base.query.v1beta1.PageRequest pagination = 3; -} - -// QueryAuctionsResponse is response type for the Query/Auctions RPC method. -message QueryAuctionsResponse { - // auctions specifies the existing auctions - repeated google.protobuf.Any auctions = 1 [(cosmos_proto.accepts_interface) = "AuctionI"]; - - // pagination defines the pagination in the response - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryAuctionRequest is the request type for the Query/Auction RPC method. -message QueryAuctionRequest { - uint64 auction_id = 1; -} - -// QueryAuctionResponse is the response type for the Query/Auction RPC method. -message QueryAuctionResponse { - google.protobuf.Any auction = 1 [(cosmos_proto.accepts_interface) = "AuctionI"]; -} - -// QueryAllowedBidderRequest is the request type for the Query/AllowedBidder RPC -// method. -message QueryAllowedBidderRequest { - uint64 auction_id = 1; - string bidder = 2; -} - -// QueryAllowedBidderResponse is the response type for the Query/AllowedBidder -// RPC method. -message QueryAllowedBidderResponse { - AllowedBidder allowed_bidder = 1 [(gogoproto.nullable) = false]; -} - -// QueryAllowedBiddersRequest is the request type for the Query/AllowedBidders -// RPC method. -message QueryAllowedBiddersRequest { - uint64 auction_id = 1; - - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryAllowedBiddersResponse is the response type for the Query/AllowedBidders -// RPC method. -message QueryAllowedBiddersResponse { - repeated AllowedBidder allowed_bidders = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryBidsRequest is request type for the Query/Bids RPC method. -message QueryBidsRequest { - uint64 auction_id = 1; - string bidder = 2; - string is_matched = 3; - cosmos.base.query.v1beta1.PageRequest pagination = 4; -} - -// QueryBidsResponse is response type for the Query/Bids RPC method. -message QueryBidsResponse { - // bids specifies the existing bids - repeated Bid bids = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryBidRequest is the request type for the Query/Sequence RPC method. -message QueryBidRequest { - uint64 auction_id = 1; - uint64 bid_id = 2; -} - -// QueryBidResponse is response type for the Query/Sequence RPC method. -message QueryBidResponse { - // bid specifies specific bid - Bid bid = 1 [(gogoproto.nullable) = false]; -} - -// QueryVestingsRequest is request type for the Query/Vestings RPC method. -message QueryVestingsRequest { - uint64 auction_id = 1; -} - -// QueryVestingsResponse is response type for the Query/Vestings RPC method. -message QueryVestingsResponse { - // vestings specifies the existing vestings - repeated VestingQueue vestings = 1 [(gogoproto.nullable) = false]; -} \ No newline at end of file diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh deleted file mode 100644 index d3411044..00000000 --- a/scripts/protocgen.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -set -eo pipefail - -# get protoc executions -go get github.com/regen-network/cosmos-proto/protoc-gen-gocosmos 2>/dev/null - -# get cosmos sdk from github -go get github.com/cosmos/cosmos-sdk 2>/dev/null - -echo "Generating gogo proto code" -cd proto -proto_dirs=$(find ./fundraising -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) -for dir in $proto_dirs; do - for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do - if grep go_package $file &>/dev/null; then - buf generate --template buf.gen.gogo.yaml $file - fi - done -done - -cd .. - -# move proto files to the right places -# -# Note: Proto files are suffixed with the current binary version. -cp -r github.com/tendermint/fundraising/* ./ -rm -rf github.com - -go mod tidy -compat=1.18 - -# TODO: Uncomment once ORM/Pulsar support is needed. -# -# ./scripts/protocgen2.sh diff --git a/scripts/protocgen2.sh b/scripts/protocgen2.sh deleted file mode 100644 index 63f61838..00000000 --- a/scripts/protocgen2.sh +++ /dev/null @@ -1,30 +0,0 @@ - # this script is for generating protobuf files for the new google.golang.org/protobuf API - - set -eo pipefail - - protoc_install_gopulsar() { - go install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar@latest - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest - } - - protoc_install_gopulsar - - echo "Cleaning API directory" - ( - cd api - find ./ -type f \( -iname \*.pulsar.go -o -iname \*.pb.go -o -iname \*.cosmos_orm.go -o -iname \*.pb.gw.go \) -delete - find . -empty -type d -delete - cd .. - ) - - echo "Generating API module" - ( - cd proto - buf generate --template buf.gen.pulsar.yaml - ) - - echo "Generate Pulsar Test Data" - ( - cd testutil/testdata - buf generate --template buf.gen.pulsar.yaml - ) diff --git a/testutil/keeper/fundraising.go b/testutil/keeper/fundraising.go new file mode 100644 index 00000000..94d47e82 --- /dev/null +++ b/testutil/keeper/fundraising.go @@ -0,0 +1,73 @@ +package keeper + +import ( + "context" + "testing" + + "cosmossdk.io/core/address" + "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/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/runtime" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "github.com/stretchr/testify/require" + + "github.com/tendermint/fundraising/x/fundraising/keeper" + "github.com/tendermint/fundraising/x/fundraising/types" +) + +func FundraisingKeeper(t testing.TB) (keeper.Keeper, context.Context, address.Codec) { + storeKey := storetypes.NewKVStoreKey(types.StoreKey) + + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) + stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) + require.NoError(t, stateStore.LoadLatestVersion()) + + registry := codectypes.NewInterfaceRegistry() + types.RegisterInterfaces(registry) + cdc := codec.NewProtoCodec(registry) + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + addressCodec := addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()) + + k := keeper.NewKeeper( + cdc, + addressCodec, + runtime.NewKVStoreService(storeKey), + log.NewNopLogger(), + authority.String(), + nil, + nil, + nil, + ) + + ctx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) + + // Initialize params + if err := k.Params.Set(ctx, types.DefaultParams()); err != nil { + t.Fatalf("failed to set params: %v", err) + } + + return k, ctx, addressCodec +} + +// FundAccount is a utility function that funds an account by minting and +// sending the coins to the address. This should be used for testing purposes +// only! +func FundAccount(bankKeeper bankkeeper.Keeper, ctx context.Context, addr sdk.AccAddress, amounts sdk.Coins) error { + if err := bankKeeper.MintCoins(ctx, minttypes.ModuleName, amounts); err != nil { + return err + } + + return bankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, addr, amounts) +} diff --git a/testutil/network/network.go b/testutil/network/network.go new file mode 100644 index 00000000..bad5aa25 --- /dev/null +++ b/testutil/network/network.go @@ -0,0 +1,80 @@ +package network + +import ( + "fmt" + "testing" + + "github.com/cosmos/cosmos-sdk/testutil/network" + "github.com/stretchr/testify/require" + + "github.com/tendermint/fundraising/app" +) + +type ( + Network = network.Network + Config = network.Config +) + +// New creates instance with fully configured cosmos network. +// Accepts optional config, that will be used in place of the DefaultConfig() if provided. +func New(t *testing.T, configs ...Config) *Network { + t.Helper() + if len(configs) > 1 { + panic("at most one config should be provided") + } + var cfg network.Config + if len(configs) == 0 { + cfg = DefaultConfig() + } else { + cfg = configs[0] + } + net, err := network.New(t, t.TempDir(), cfg) + require.NoError(t, err) + _, err = net.WaitForHeight(1) + require.NoError(t, err) + t.Cleanup(net.Cleanup) + return net +} + +// DefaultConfig will initialize config for the network with custom application, +// genesis and single validator. All other parameters are inherited from cosmos-sdk/testutil/network.DefaultConfig +func DefaultConfig() network.Config { + cfg, err := network.DefaultConfigWithAppConfig(app.AppConfig()) + if err != nil { + panic(err) + } + ports, err := freePorts(3) + if err != nil { + panic(err) + } + if cfg.APIAddress == "" { + cfg.APIAddress = fmt.Sprintf("tcp://0.0.0.0:%s", ports[0]) + } + if cfg.RPCAddress == "" { + cfg.RPCAddress = fmt.Sprintf("tcp://0.0.0.0:%s", ports[1]) + } + if cfg.GRPCAddress == "" { + cfg.GRPCAddress = fmt.Sprintf("0.0.0.0:%s", ports[2]) + } + return cfg +} + +// freePorts return the available ports based on the number of requested ports. +func freePorts(n int) ([]string, error) { + closeFns := make([]func() error, n) + ports := make([]string, n) + for i := 0; i < n; i++ { + _, port, closeFn, err := network.FreeTCPAddr() + if err != nil { + return nil, err + } + ports[i] = port + closeFns[i] = closeFn + } + for _, closeFn := range closeFns { + if err := closeFn(); err != nil { + return nil, err + } + } + return ports, nil +} diff --git a/testutil/nullify/nullify.go b/testutil/nullify/nullify.go new file mode 100644 index 00000000..3b968c09 --- /dev/null +++ b/testutil/nullify/nullify.go @@ -0,0 +1,57 @@ +// Package nullify provides methods to init nil values structs for test assertion. +package nullify + +import ( + "reflect" + "unsafe" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + coinType = reflect.TypeOf(sdk.Coin{}) + coinsType = reflect.TypeOf(sdk.Coins{}) +) + +// Fill analyze all struct fields and slices with +// reflection and initialize the nil and empty slices, +// structs, and pointers. +func Fill(x interface{}) interface{} { + v := reflect.Indirect(reflect.ValueOf(x)) + switch v.Kind() { + case reflect.Slice: + for i := 0; i < v.Len(); i++ { + obj := v.Index(i) + objPt := reflect.NewAt(obj.Type(), unsafe.Pointer(obj.UnsafeAddr())).Interface() + objPt = Fill(objPt) + obj.Set(reflect.ValueOf(objPt)) + } + case reflect.Struct: + for i := 0; i < v.NumField(); i++ { + f := reflect.Indirect(v.Field(i)) + if !f.CanSet() { + continue + } + switch f.Kind() { + case reflect.Slice: + f.Set(reflect.MakeSlice(f.Type(), 0, 0)) + case reflect.Struct: + switch f.Type() { + case coinType: + coin := reflect.New(coinType).Interface() + s := reflect.ValueOf(coin).Elem() + f.Set(s) + case coinsType: + coins := reflect.New(coinsType).Interface() + s := reflect.ValueOf(coins).Elem() + f.Set(s) + default: + objPt := reflect.NewAt(f.Type(), unsafe.Pointer(f.UnsafeAddr())).Interface() + s := Fill(objPt) + f.Set(reflect.ValueOf(s)) + } + } + } + } + return reflect.Indirect(v).Interface() +} diff --git a/testutil/sample/sample.go b/testutil/sample/sample.go new file mode 100644 index 00000000..858d9c99 --- /dev/null +++ b/testutil/sample/sample.go @@ -0,0 +1,23 @@ +package sample + +import ( + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// PubKey returns a sample public key. +func PubKey() cryptotypes.PubKey { + return ed25519.GenPrivKey().PubKey() +} + +// AccAddress returns a sample account address. +func AccAddress() sdk.AccAddress { + addr := PubKey().Address() + return sdk.AccAddress(addr) +} + +// Address returns a sample account address string. +func Address() string { + return AccAddress().String() +} diff --git a/testutil/simapp/simapp.go b/testutil/testutil/simapp/simapp.go similarity index 66% rename from testutil/simapp/simapp.go rename to testutil/testutil/simapp/simapp.go index 96ae6d71..15d8bcff 100644 --- a/testutil/simapp/simapp.go +++ b/testutil/testutil/simapp/simapp.go @@ -3,20 +3,22 @@ package simapp // DONTCOVER import ( + "context" "encoding/json" "time" + "cosmossdk.io/log" "cosmossdk.io/math" - tmdb "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" tmtypes "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client/flags" "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/ed25519" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/testutil/mock" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" @@ -24,33 +26,40 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/tendermint/fundraising/app" - "github.com/tendermint/fundraising/cmd" + "github.com/tendermint/fundraising/testutil/sample" ) // New creates application instance with in-memory database and disabled logging. -func New(chainID, dir string) *app.App { +func New(chainID string) (*app.App, error) { var ( - db = tmdb.NewMemDB() + db = dbm.NewMemDB() logger = log.NewNopLogger() - encCdc = cmd.MakeEncodingConfig(app.ModuleBasics) - - a = app.New( - logger, - db, - nil, - true, - map[int64]bool{}, - dir, - 0, - encCdc, - simtestutil.EmptyAppOptions{}, - baseapp.SetChainID(chainID), - ) - - genesisState = app.NewDefaultGenesisState(encCdc.Marshaler) + ) + + appOptions := simtestutil.AppOptionsMap{ + flags.FlagHome: app.DefaultNodeHome, + server.FlagInvCheckPeriod: simcli.FlagPeriodValue, + } + + fundraisingApp, err := app.New( + logger, + db, + nil, + true, + appOptions, + fauxMerkleModeOpt, + baseapp.SetChainID(chainID), + ) + if err != nil { + return nil, err + } + + var ( + genesisState = fundraisingApp.DefaultGenesis() privVal = mock.NewPV() pubKey, _ = privVal.GetPubKey() @@ -59,41 +68,43 @@ func New(chainID, dir string) *app.App { valSet = tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) // generate genesis account - senderPrivKey = secp256k1.GenPrivKey() - acc = authtypes.NewBaseAccount(senderPrivKey.PubKey().Address().Bytes(), senderPrivKey.PubKey(), 0, 0) - balances = banktypes.Balance{ + senderPubKey = sample.PubKey() + acc = authtypes.NewBaseAccount(sdk.AccAddress(senderPubKey.Address()), senderPubKey, 0, 0) + balances = banktypes.Balance{ Address: acc.GetAddress().String(), - Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100000000000000))), + Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100000000000000))), } ) - // init chain must be called to stop deliverState from being nil - genesisState = genesisStateWithValSet(&a, encCdc.Marshaler, genesisState, valSet, []authtypes.GenesisAccount{acc}, balances) + genesisState = genesisStateWithValSet(fundraisingApp.AppCodec(), genesisState, valSet, []authtypes.GenesisAccount{acc}, balances) stateBytes, err := json.MarshalIndent(genesisState, "", " ") if err != nil { - panic(err) + return nil, err } - // InitChain updates deliverState which is required when app.NewContext is called - a.InitChain( - abci.RequestInitChain{ - Validators: []abci.ValidatorUpdate{}, - ConsensusParams: simtestutil.DefaultConsensusParams, - AppStateBytes: stateBytes, - ChainId: chainID, + if _, err := fundraisingApp.InitChain( + &abci.RequestInitChain{ + ChainId: chainID, + AppStateBytes: stateBytes, }, - ) - - fundraisingApp := a.(*app.App) + ); err != nil { + return nil, err + } - return fundraisingApp + return fundraisingApp, nil } type GenerateAccountStrategy func(int) []sdk.AccAddress +// fauxMerkleModeOpt returns a BaseApp option to use a dbStoreAdapter instead of +// an IAVLStore for faster simulation speed. +func fauxMerkleModeOpt(bapp *baseapp.BaseApp) { + bapp.SetFauxMerkleMode() +} + // AddTestAddrs constructs and returns accNum amount of accounts with an // initial balance of accAmt in random order -func AddTestAddrs(app *app.App, ctx sdk.Context, accNum int, accAmt math.Int) []sdk.AccAddress { +func AddTestAddrs(app *app.App, ctx context.Context, accNum int, accAmt math.Int) []sdk.AccAddress { return addTestAddrs(app, ctx, accNum, accAmt, createRandomAccounts) } @@ -108,7 +119,7 @@ func createRandomAccounts(accNum int) []sdk.AccAddress { return testAddrs } -func addTestAddrs(app *app.App, ctx sdk.Context, accNum int, accAmt math.Int, strategy GenerateAccountStrategy) []sdk.AccAddress { +func addTestAddrs(app *app.App, ctx context.Context, accNum int, accAmt math.Int, strategy GenerateAccountStrategy) []sdk.AccAddress { testAddrs := strategy(accNum) initCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, accAmt)) @@ -120,7 +131,7 @@ func addTestAddrs(app *app.App, ctx sdk.Context, accNum int, accAmt math.Int, st return testAddrs } -func initAccountWithCoins(app *app.App, ctx sdk.Context, addr sdk.AccAddress, coins sdk.Coins) { +func initAccountWithCoins(app *app.App, ctx context.Context, addr sdk.AccAddress, coins sdk.Coins) { err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, coins) if err != nil { panic(err) @@ -135,7 +146,7 @@ func initAccountWithCoins(app *app.App, ctx sdk.Context, addr sdk.AccAddress, co // FundAccount is a utility function that funds an account by minting and // sending the coins to the address. This should be used for testing purposes // only! -func FundAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, amounts sdk.Coins) error { +func FundAccount(bankKeeper bankkeeper.Keeper, ctx context.Context, addr sdk.AccAddress, amounts sdk.Coins) error { if err := bankKeeper.MintCoins(ctx, minttypes.ModuleName, amounts); err != nil { return err } @@ -144,8 +155,10 @@ func FundAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddr } func genesisStateWithValSet( - app *cmd.App, cdc codec.Codec, genesisState app.GenesisState, - valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, + cdc codec.Codec, + genesisState app.GenesisState, + valSet *tmtypes.ValidatorSet, + genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance, ) app.GenesisState { // set genesis accounts @@ -158,23 +171,24 @@ func genesisStateWithValSet( bondAmt := sdk.DefaultPowerReduction for _, val := range valSet.Validators { - pk, _ := cryptocodec.FromTmPubKeyInterface(val.PubKey) + pk, _ := cryptocodec.FromCmtPubKeyInterface(val.PubKey) pkAny, _ := codectypes.NewAnyWithValue(pk) + valAddr := sdk.ValAddress(val.Address).String() validator := stakingtypes.Validator{ - OperatorAddress: sdk.ValAddress(val.Address).String(), + OperatorAddress: valAddr, ConsensusPubkey: pkAny, Jailed: false, Status: stakingtypes.Bonded, Tokens: bondAmt, - DelegatorShares: sdk.OneDec(), + DelegatorShares: math.LegacyOneDec(), Description: stakingtypes.Description{}, UnbondingHeight: int64(0), UnbondingTime: time.Unix(0, 0).UTC(), - Commission: stakingtypes.NewCommission(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()), - MinSelfDelegation: sdk.ZeroInt(), + Commission: stakingtypes.NewCommission(math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec()), + MinSelfDelegation: math.ZeroInt(), } validators = append(validators, validator) - delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), sdk.OneDec())) + delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress().String(), valAddr, math.LegacyOneDec())) } // set validators and delegations diff --git a/tools/tools.go b/tools/tools.go index 36ee7b2e..25040ac3 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -6,10 +6,7 @@ import ( _ "github.com/bufbuild/buf/cmd/buf" _ "github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar" _ "github.com/cosmos/gogoproto/protoc-gen-gocosmos" - _ "github.com/golang/protobuf/protoc-gen-go" - _ "github.com/golangci/golangci-lint/cmd/golangci-lint" _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2" _ "golang.org/x/tools/cmd/goimports" _ "google.golang.org/grpc/cmd/protoc-gen-go-grpc" diff --git a/x/fundraising/client/cli/flags.go b/x/fundraising/client/cli/flags.go deleted file mode 100644 index f6fc22fb..00000000 --- a/x/fundraising/client/cli/flags.go +++ /dev/null @@ -1,34 +0,0 @@ -package cli - -// DONTCOVER - -import ( - flag "github.com/spf13/pflag" -) - -const ( - FlagAuctionStatus = "status" - FlagAuctionType = "type" - FlagBidderAddr = "bidder-addr" - FlagIsMatched = "is-matched" -) - -// flagSetAuctions returns a set of defined flags to query the auctions. -func flagSetAuctions() *flag.FlagSet { - fs := flag.NewFlagSet("", flag.ContinueOnError) - - fs.String(FlagAuctionStatus, "", "The auction status; AUCTION_STATUS_STANDBY, AUCTION_STATUS_STARTED, and etc.") - fs.String(FlagAuctionType, "", "The auction type; AUCTION_TYPE_FIXED_PRICE or AUCTION_TYPE_ENGLISH") - - return fs -} - -// flagSetBids returns a set of defined flags to query the bids. -func flagSetBids() *flag.FlagSet { - fs := flag.NewFlagSet("", flag.ContinueOnError) - - fs.String(FlagBidderAddr, "", "The bech32 address of the bidder account") - fs.String(FlagIsMatched, "", "The bid that is successfully matched (a.k.a., winner)") - - return fs -} diff --git a/x/fundraising/client/cli/query.go b/x/fundraising/client/cli/query.go deleted file mode 100644 index cd8df91b..00000000 --- a/x/fundraising/client/cli/query.go +++ /dev/null @@ -1,380 +0,0 @@ -package cli - -import ( - "context" - "fmt" - "strconv" - "strings" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/version" - - "github.com/tendermint/fundraising/x/fundraising/types" -) - -// GetQueryCmd returns the cli query commands for this module -func GetQueryCmd(queryRoute string) *cobra.Command { - // Group fundraising queries under a subcommand - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - // this line is used by starport scaffolding # 1 - cmd.AddCommand( - NewQueryParamsCmd(), - NewQueryAuctionsCmd(), - NewQueryAuctionCmd(), - NewQueryAllowedBidderCmd(), - NewQueryAllowedBiddersCmd(), - NewQueryBidsCmd(), - NewQueryVestingsCmd(), - ) - - return cmd -} - -func NewQueryParamsCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Args: cobra.NoArgs, - Short: "Query the current fundraising parameters information", - Long: strings.TrimSpace( - fmt.Sprintf(`Query values set as fundraising parameters. -Example: -$ %s query %s params -`, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - resp, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(&resp.Params) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func NewQueryAuctionsCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "auctions", - Args: cobra.NoArgs, - Short: "Query for all auctions", - Long: strings.TrimSpace( - fmt.Sprintf(`Query for all auctions with the given optional flags. -Example: -$ %s query %s auctions -$ %s query %s auctions --status AUCTION_STATUS_STANDBY -$ %s query %s auctions --type AUCTION_TYPE_FIXED_PRICE - -Auction statuses: AUCTION_STATUS_STANDBY, AUCTION_STATUS_STARTED, AUCTION_STATUS_VESTING, AUCTION_STATUS_FINISHED, and AUCTION_STATUS_CANCELLED -Auction types: AUCTION_TYPE_FIXED_PRICE and AUCTION_TYPE_ENGLISH -`, - version.AppName, types.ModuleName, - 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 - } - - status, _ := cmd.Flags().GetString(FlagAuctionStatus) - typ, _ := cmd.Flags().GetString(FlagAuctionType) - - queryClient := types.NewQueryClient(clientCtx) - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - req := &types.QueryAuctionsRequest{ - Status: status, - Type: typ, - Pagination: pageReq, - } - - resp, err := queryClient.Auctions(cmd.Context(), req) - if err != nil { - return err - } - - return clientCtx.PrintProto(resp) - }, - } - - cmd.Flags().AddFlagSet(flagSetAuctions()) - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func NewQueryAuctionCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "auction [auction-id]", - Args: cobra.ExactArgs(1), - Short: "Query a specific auction", - Long: strings.TrimSpace( - fmt.Sprintf(`Query details about a specific auction. -Example: -$ %s query %s auction 1 -`, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - auctionId, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "auction-id %s is not valid", args[0]) - } - - queryClient := types.NewQueryClient(clientCtx) - - resp, err := queryClient.Auction(cmd.Context(), &types.QueryAuctionRequest{ - AuctionId: auctionId, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(resp) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func NewQueryAllowedBidderCmd() *cobra.Command { - bech32PrefixAccAddr := sdk.GetConfig().GetBech32AccountAddrPrefix() - - cmd := &cobra.Command{ - Use: "allowed-bidder [auction-id] [bidder]", - Args: cobra.ExactArgs(2), - Short: "Query a specific allowed bidder information", - Long: strings.TrimSpace( - fmt.Sprintf(`Query details about a specific allowed bidder. -Example: -$ %s query %s allowed-bidder 1 %ss1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj -`, - version.AppName, types.ModuleName, bech32PrefixAccAddr, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - auctionId, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "auction-id %s is not valid", args[0]) - } - - bidderAddr, err := sdk.AccAddressFromBech32(args[1]) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - resp, err := queryClient.AllowedBidder(cmd.Context(), &types.QueryAllowedBidderRequest{ - AuctionId: auctionId, - Bidder: bidderAddr.String(), - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(resp) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func NewQueryAllowedBiddersCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "allowed-bidders [auction-id]", - Args: cobra.ExactArgs(1), - Short: "Query all allowed bidders for the auction", - Long: strings.TrimSpace( - fmt.Sprintf(`Query all allowed bidders for the auction. -Example: -$ %s query %s allowed-bidders 1 -`, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - auctionId, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "auction-id %s is not valid", args[0]) - } - - queryClient := types.NewQueryClient(clientCtx) - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - req := &types.QueryAllowedBiddersRequest{ - AuctionId: auctionId, - Pagination: pageReq, - } - - resp, err := queryClient.AllowedBidders(cmd.Context(), req) - if err != nil { - return err - } - - return clientCtx.PrintProto(resp) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func NewQueryBidsCmd() *cobra.Command { - bech32PrefixAccAddr := sdk.GetConfig().GetBech32AccountAddrPrefix() - - cmd := &cobra.Command{ - Use: "bids [auction-id]", - Args: cobra.ExactArgs(1), - Short: "Query all bids for the auction", - Long: strings.TrimSpace( - fmt.Sprintf(`Query all bids for the auction. -Example: -$ %s query %s bids 1 -$ %s query %s bids 1 --bidder %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj -$ %s query %s bids 1 --matched-bidder -`, - version.AppName, types.ModuleName, - version.AppName, types.ModuleName, bech32PrefixAccAddr, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - bidderAddr, _ := cmd.Flags().GetString(FlagBidderAddr) - isMatched, _ := cmd.Flags().GetString(FlagIsMatched) - - auctionId, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "auction-id %s is not valid", args[0]) - } - - queryClient := types.NewQueryClient(clientCtx) - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - req := &types.QueryBidsRequest{ - AuctionId: auctionId, - Bidder: bidderAddr, - IsMatched: isMatched, - Pagination: pageReq, - } - - resp, err := queryClient.Bids(cmd.Context(), req) - if err != nil { - return err - } - - return clientCtx.PrintProto(resp) - }, - } - - cmd.Flags().AddFlagSet(flagSetBids()) - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func NewQueryVestingsCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "vestings [auction-id]", - Args: cobra.ExactArgs(1), - Short: "Query vesting schedules about the auction", - Long: strings.TrimSpace( - fmt.Sprintf(`Query vesting schedules for the auction. -Example: -$ %s query %s vestings 1 -`, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - auctionId, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "auction-id %s is not valid", args[0]) - } - - queryClient := types.NewQueryClient(clientCtx) - - req := &types.QueryVestingsRequest{ - AuctionId: auctionId, - } - - resp, err := queryClient.Vestings(cmd.Context(), req) - if err != nil { - return err - } - - return clientCtx.PrintProto(resp) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/fundraising/client/cli/tx.go b/x/fundraising/client/cli/tx.go deleted file mode 100644 index ed3e7383..00000000 --- a/x/fundraising/client/cli/tx.go +++ /dev/null @@ -1,436 +0,0 @@ -package cli - -import ( - "fmt" - "strconv" - "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" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/version" - - "github.com/tendermint/fundraising/x/fundraising/keeper" - "github.com/tendermint/fundraising/x/fundraising/types" -) - -// GetTxCmd returns the transaction commands for this module -func GetTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - NewCreateFixedPriceAuctionCmd(), - NewCreateBatchAuctionCmd(), - NewCancelAuctionCmd(), - NewPlaceBidCmd(), - NewModifyBidCmd(), - ) - if keeper.EnableAddAllowedBidder { - cmd.AddCommand(NewAddAllowedBidderCmd()) - } - return cmd -} - -func NewCreateFixedPriceAuctionCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "create-fixed-price-auction [file]", - Args: cobra.ExactArgs(1), - Short: "Create a fixed price auction", - Long: strings.TrimSpace( - fmt.Sprintf(`Create a fixed price auction. -The auction details must be provided through a JSON file. - -Example: -$ %s tx %s create-fixed-price-auction --from mykey - -Where auction.json contains: - -{ - "start_price": "1.000000000000000000", - "selling_coin": { - "denom": "denom1", - "amount": "1000000000000" - }, - "paying_coin_denom": "denom2", - "vesting_schedules": [ - { - "release_time": "2022-01-01T00:00:00Z", - "weight": "0.500000000000000000" - }, - { - "release_time": "2022-06-01T00:00:00Z", - "weight": "0.250000000000000000" - }, - { - "release_time": "2022-12-01T00:00:00Z", - "weight": "0.250000000000000000" - } - ], - "start_time": "2021-11-01T00:00:00Z", - "end_time": "2021-12-01T00:00:00Z" -} - -Description of the parameters: - -[start_price]: the start price of the selling coin that is proportional to the paying coin denom -[selling_coin]: the selling amount of coin for the auction -[paying_coin_denom]: the paying coin denom that the auctioneer wants to exchange with -[vesting_schedules]: the vesting schedules that release the paying coins to the auctioneer -[start_time]: the start time of the auction -[end_time]: the end time of the auction -`, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - auction, err := ParseFixedPriceAuctionRequest(args[0]) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "failed to parse %s file due to %v", args[0], err) - } - - msg := types.NewMsgCreateFixedPriceAuction( - clientCtx.GetFromAddress().String(), - auction.StartPrice, - auction.SellingCoin, - auction.PayingCoinDenom, - auction.VestingSchedules, - auction.StartTime, - auction.EndTime, - ) - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} - -func NewCreateBatchAuctionCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "create-batch-auction [file]", - Args: cobra.ExactArgs(1), - Short: "Create a batch auction", - Long: strings.TrimSpace( - fmt.Sprintf(`Create a batch auction. -The auction details must be provided through a JSON file. - -Example: -$ %s tx %s create-batch-auction --from mykey - -Where auction.json contains: -{ - "start_price": "0.500000000000000000", - "min_bid_price": "0.100000000000000000", - "selling_coin": { - "denom": "denom1", - "amount": "1000000000000" - }, - "paying_coin_denom": "denom2", - "vesting_schedules": [ - { - "release_time": "2023-06-01T00:00:00Z", - "weight": "0.500000000000000000" - }, - { - "release_time": "2023-12-01T00:00:00Z", - "weight": "0.500000000000000000" - } - ], - "max_extended_round": 2, - "extended_round_rate": "0.150000000000000000", - "start_time": "2022-02-01T00:00:00Z", - "end_time": "2022-06-20T00:00:00Z" -} - -Description of the parameters: - -[start_price]: the start price of the selling coin that is proportional to the paying coin denom -[selling_coin]: the selling amount of coin for the auction -[paying_coin_denom]: the paying coin denom that the auctioneer wants to exchange with -[vesting_schedules]: the vesting schedules that release the paying coins to the autioneer -[max_extended_round]: the number of extended rounds -[extended_round_rate]: the rate that determines if the auction needs to run another round -[start_time]: the start time of the auction -[end_time]: the end time of the auction -`, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - auction, err := ParseBatchAuctionRequest(args[0]) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "failed to parse %s file due to %v", args[0], err) - } - - msg := types.NewMsgCreateBatchAuction( - clientCtx.GetFromAddress().String(), - auction.StartPrice, - auction.MinBidPrice, - auction.SellingCoin, - auction.PayingCoinDenom, - auction.VestingSchedules, - auction.MaxExtendedRound, - auction.ExtendedRoundRate, - auction.StartTime, - auction.EndTime, - ) - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} - -func NewCancelAuctionCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "cancel [auction-id]", - Args: cobra.ExactArgs(1), - Short: "Cancel the auction", - Long: strings.TrimSpace( - fmt.Sprintf(`Cancel the auction with the id. - -Example: -$ %s tx %s cancel 1 --from mykey -`, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - auctionId, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - - msg := types.NewMsgCancelAuction( - clientCtx.GetFromAddress().String(), - auctionId, - ) - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} - -func NewPlaceBidCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "bid [auction-id] [bid-type] [price] [coin]", - Args: cobra.ExactArgs(4), - Short: "Bid for the auction", - Long: strings.TrimSpace( - fmt.Sprintf(`Bid for the auction with what price and amount of coin you want to bid for. - -Bid Type Options: -1. fixed-price (fp or f) -2. batch-worth (bw or w) -3. batch-many (bm or m) - -Example: -$ %s tx %s bid 1 fixed-price 0.55 100000000denom2 --from mykey -$ %s tx %s bid 1 batch-worth 0.55 100000000denom2 --from mykey -$ %s tx %s bid 1 batch-many 0.55 100000000denom1 --from mykey -$ %s tx %s bid 1 fp 0.55 100000000denom2 --from mykey -$ %s tx %s bid 1 bw 0.55 100000000denom2 --from mykey -$ %s tx %s bid 1 bm 0.55 100000000denom1 --from mykey - -Note: -In case of placing a bid for a fixed price auction, you must provide [price] argument with the same price of the auction. -In case of placing a bid for a batch auction, there are two bid type options; batch-worth and batch-many, which you can find more information -in our technical spec docs. https://github.com/tendermint/fundraising/blob/main/x/fundraising/spec/01_concepts.md -`, - version.AppName, types.ModuleName, - version.AppName, types.ModuleName, - version.AppName, types.ModuleName, - version.AppName, types.ModuleName, - version.AppName, types.ModuleName, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - auctionId, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - - bidType, err := ParseBidType(args[1]) - if err != nil { - return fmt.Errorf("parse order direction: %w", err) - } - - price, err := sdk.NewDecFromStr(args[2]) - if err != nil { - return err - } - - coin, err := sdk.ParseCoinNormalized(args[3]) - if err != nil { - return err - } - - msg := types.NewMsgPlaceBid( - auctionId, - clientCtx.GetFromAddress().String(), - bidType, - price, - coin, - ) - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} - -func NewModifyBidCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "modify-bid [auction-id] [bid-id] [price] [coin]", - Args: cobra.ExactArgs(4), - Short: "Modify the bid", - Long: strings.TrimSpace( - fmt.Sprintf(`Modify the bid with new price and coin. -Either price or coin must be higher than the existing bid. - -Example: -$ %s tx %s bid 1 1 1.0 100000000denom2 --from mykey -`, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - auctionId, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - - bidId, err := strconv.ParseUint(args[1], 10, 64) - if err != nil { - return err - } - - price, err := sdk.NewDecFromStr(args[2]) - if err != nil { - return err - } - - coin, err := sdk.ParseCoinNormalized(args[3]) - if err != nil { - return err - } - - msg := types.NewMsgModifyBid( - auctionId, - clientCtx.GetFromAddress().String(), - bidId, - price, - coin, - ) - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} - -func NewAddAllowedBidderCmd() *cobra.Command { - bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() - - cmd := &cobra.Command{ - Use: "add-allowed-bidder [auction-id] [bidder] [max-bid-amount]", - Args: cobra.ExactArgs(3), - Short: "(Testing) Add an allowed bidder for the auction", - Long: strings.TrimSpace( - fmt.Sprintf(`Add an allowed bidder for the auction. -This message is available for testing purpose and it is only accessible when you build the binary with testing mode. - -Example: -$ %s tx %s add-allowed-bidder 1 %s1mzgucqnfr2l8cj5apvdpllhzt4zeuh2cshz5xu 10000000000 --from mykey -`, - version.AppName, types.ModuleName, bech32PrefixValAddr, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - auctionId, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - - bidderAddr, err := sdk.AccAddressFromBech32(args[1]) - if err != nil { - return err - } - - maxBidAmt, ok := sdk.NewIntFromString(args[2]) - if !ok { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "maximum bid price must be a positive integer") - } - - msg := types.NewMsgAddAllowedBidder( - auctionId, - types.AllowedBidder{ - Bidder: bidderAddr.String(), - MaxBidAmount: maxBidAmt, - }, - ) - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/fundraising/client/cli/utils.go b/x/fundraising/client/cli/utils.go deleted file mode 100644 index 41e264af..00000000 --- a/x/fundraising/client/cli/utils.go +++ /dev/null @@ -1,95 +0,0 @@ -package cli - -import ( - "encoding/json" - "fmt" - "os" - "strings" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/tendermint/fundraising/x/fundraising/types" -) - -// FixedPriceAuctionRequest defines CLI request for a fixed price auction. -type FixedPriceAuctionRequest struct { - StartPrice sdk.Dec `json:"start_price"` - SellingCoin sdk.Coin `json:"selling_coin"` - PayingCoinDenom string `json:"paying_coin_denom"` - VestingSchedules []types.VestingSchedule `json:"vesting_schedules"` - StartTime time.Time `json:"start_time"` - EndTime time.Time `json:"end_time"` -} - -// ParseFixedPriceAuctionRequest reads the file and parses FixedPriceAuctionRequest. -func ParseFixedPriceAuctionRequest(fileName string) (req FixedPriceAuctionRequest, err error) { - contents, err := os.ReadFile(fileName) - if err != nil { - return req, err - } - - if err = json.Unmarshal(contents, &req); err != nil { - return req, err - } - - return req, nil -} - -// String returns a human readable string representation of the request. -func (req FixedPriceAuctionRequest) String() string { - result, err := json.Marshal(&req) - if err != nil { - panic(err) - } - return string(result) -} - -// BatchAuctionRequest defines CLI request for an batch auction. -type BatchAuctionRequest struct { - StartPrice sdk.Dec `json:"start_price"` - MinBidPrice sdk.Dec `json:"min_bid_price"` - SellingCoin sdk.Coin `json:"selling_coin"` - PayingCoinDenom string `json:"paying_coin_denom"` - MaxExtendedRound uint32 `json:"max_extended_round"` - ExtendedRoundRate sdk.Dec `json:"extended_round_rate"` - VestingSchedules []types.VestingSchedule `json:"vesting_schedules"` - StartTime time.Time `json:"start_time"` - EndTime time.Time `json:"end_time"` -} - -// ParseBatchAuctionRequest reads the file and parses BatchAuctionRequest. -func ParseBatchAuctionRequest(fileName string) (req BatchAuctionRequest, err error) { - contents, err := os.ReadFile(fileName) - if err != nil { - return req, err - } - - if err = json.Unmarshal(contents, &req); err != nil { - return req, err - } - - return req, nil -} - -// String returns a human readable string representation of the request. -func (req BatchAuctionRequest) String() string { - result, err := json.Marshal(&req) - if err != nil { - panic(err) - } - return string(result) -} - -// ParseBidType parses bid type string and returns types.BidType. -func ParseBidType(s string) (types.BidType, error) { - switch strings.ToLower(s) { - case "fixed-price", "fp", "f": - return types.BidTypeFixedPrice, nil - case "batch-worth", "bw", "w": - return types.BidTypeBatchWorth, nil - case "batch-many", "bm", "m": - return types.BidTypeBatchMany, nil - } - return 0, fmt.Errorf("invalid bid type: %s", s) -} diff --git a/x/fundraising/client/cli/utils_test.go b/x/fundraising/client/cli/utils_test.go deleted file mode 100644 index aef6ef93..00000000 --- a/x/fundraising/client/cli/utils_test.go +++ /dev/null @@ -1,196 +0,0 @@ -package cli_test - -import ( - "fmt" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/tendermint/fundraising/x/fundraising/client/cli" - "github.com/tendermint/fundraising/x/fundraising/types" -) - -func TestParseFixedPriceAuction(t *testing.T) { - okJSON := testutil.WriteToNewTempFile(t, ` -{ - "start_price": "1.000000000000000000", - "selling_coin": { - "denom": "denom1", - "amount": "1000000000000" - }, - "paying_coin_denom": "denom2", - "vesting_schedules": [ - { - "release_time": "2022-01-01T00:00:00Z", - "weight": "0.500000000000000000" - }, - { - "release_time": "2022-06-01T00:00:00Z", - "weight": "0.250000000000000000" - }, - { - "release_time": "2022-12-01T00:00:00Z", - "weight": "0.250000000000000000" - } - ], - "start_time": "2021-11-01T00:00:00Z", - "end_time": "2021-12-01T00:00:00Z" -} -`) - - expSchedules := []types.VestingSchedule{ - { - ReleaseTime: types.MustParseRFC3339("2022-01-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.50"), - }, - { - ReleaseTime: types.MustParseRFC3339("2022-06-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.25"), - }, - { - ReleaseTime: types.MustParseRFC3339("2022-12-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.25"), - }, - } - - auction, err := cli.ParseFixedPriceAuctionRequest("") - require.Error(t, err) - - auction, err = cli.ParseFixedPriceAuctionRequest(okJSON.Name()) - require.NoError(t, err) - require.NotEmpty(t, auction.String()) - require.Equal(t, sdk.MustNewDecFromStr("1.0"), auction.StartPrice) - require.Equal(t, sdk.NewInt64Coin("denom1", 1000000000000), auction.SellingCoin) - require.Equal(t, "denom2", auction.PayingCoinDenom) - require.EqualValues(t, expSchedules, auction.VestingSchedules) -} - -func TestParseBatchAuction(t *testing.T) { - okJSON := testutil.WriteToNewTempFile(t, ` -{ - "start_price": "1.000000000000000000", - "min_bid_price": "0.100000000000000000", - "selling_coin": { - "denom": "denom1", - "amount": "1000000000000" - }, - "paying_coin_denom": "denom2", - "vesting_schedules": [ - { - "release_time": "2022-01-01T00:00:00Z", - "weight": "0.500000000000000000" - }, - { - "release_time": "2022-06-01T00:00:00Z", - "weight": "0.250000000000000000" - }, - { - "release_time": "2022-12-01T00:00:00Z", - "weight": "0.250000000000000000" - } - ], - "max_extended_round": 3, - "extended_round_rate": "0.200000000000000000", - "start_time": "2021-11-01T00:00:00Z", - "end_time": "2021-12-01T00:00:00Z" -} -`) - - expSchedules := []types.VestingSchedule{ - { - ReleaseTime: types.MustParseRFC3339("2022-01-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.50"), - }, - { - ReleaseTime: types.MustParseRFC3339("2022-06-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.25"), - }, - { - ReleaseTime: types.MustParseRFC3339("2022-12-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.25"), - }, - } - - auction, err := cli.ParseBatchAuctionRequest("") - require.Error(t, err) - - auction, err = cli.ParseBatchAuctionRequest(okJSON.Name()) - require.NoError(t, err) - require.NotEmpty(t, auction.String()) - require.Equal(t, sdk.MustNewDecFromStr("1.0"), auction.StartPrice) - require.Equal(t, sdk.MustNewDecFromStr("0.1"), auction.MinBidPrice) - require.Equal(t, sdk.NewInt64Coin("denom1", 1000000000000), auction.SellingCoin) - require.Equal(t, "denom2", auction.PayingCoinDenom) - require.Equal(t, uint32(3), auction.MaxExtendedRound) - require.Equal(t, sdk.MustNewDecFromStr("0.2"), auction.ExtendedRoundRate) - require.EqualValues(t, expSchedules, auction.VestingSchedules) -} - -func TestParseBidType(t *testing.T) { - for _, tc := range []struct { - bidType string - expectedErr error - }{ - {"fixed-price", nil}, - {"fp", nil}, - {"f", nil}, - {"batch-worth", nil}, - {"bw", nil}, - {"w", nil}, - {"batch-many", nil}, - {"bm", nil}, - {"m", nil}, - {"fixedprice", fmt.Errorf("invalid bid type: %s", "fixedprice")}, - {"batchworth", fmt.Errorf("invalid bid type: %s", "batchworth")}, - {"batchmany", fmt.Errorf("invalid bid type: %s", "batchmany")}, - } { - _, err := cli.ParseBidType(tc.bidType) - if tc.expectedErr == nil { - require.NoError(t, err) - } else { - require.Error(t, err) - } - } -} - -func TestParseInvalidAuction(t *testing.T) { - invalidFixedAuctionJSON := testutil.WriteToNewTempFile(t, ` -{ - "start_price": "1.000000000000000000", - "selling_coin": { - "denom": "denom1", - "amount": "1000000000000" - }, - "paying_coin_denom": "denom2", - "vesting_schedules": [], - "start_time": "2021-11-01T00:00:00Z", - "end_time": "2021-12-01T00:00:00Z",,, -} -`) - - _, err := cli.ParseFixedPriceAuctionRequest(invalidFixedAuctionJSON.Name()) - require.Error(t, err) - - invalidBatchAuctionJSON := testutil.WriteToNewTempFile(t, ` -{ - "start_price": "1", - "min_bid_price": "0.100000000000000000", - "selling_coin": { - "denom": "denom1", - "amount": "1000000000000" - }, - "paying_coin_denom": "denom2", - "vesting_schedules": [], - "max_extended_round": 3, - "extended_round_rate": "0.200000000000000000", - "start_time": "2021-11-01T00:00:00Z", - "end_time": "2021-12-01T00:00:00Z",,, -} -`) - - _, err = cli.ParseBatchAuctionRequest(invalidBatchAuctionJSON.Name()) - require.Error(t, err) -} diff --git a/x/fundraising/client/testutil/cli_test.go b/x/fundraising/client/testutil/cli_test.go deleted file mode 100644 index 425f3785..00000000 --- a/x/fundraising/client/testutil/cli_test.go +++ /dev/null @@ -1,18 +0,0 @@ -//go:build norace -// +build norace - -package testutil - -import ( - "testing" - - "github.com/stretchr/testify/suite" -) - -func TestTxCmdTestSuite(t *testing.T) { - suite.Run(t, new(TxCmdTestSuite)) -} - -func TestQueryCmdTestSuite(t *testing.T) { - suite.Run(t, new(QueryCmdTestSuite)) -} diff --git a/x/fundraising/client/testutil/helpers.go b/x/fundraising/client/testutil/helpers.go deleted file mode 100644 index e9b5f2ca..00000000 --- a/x/fundraising/client/testutil/helpers.go +++ /dev/null @@ -1,103 +0,0 @@ -package testutil - -// DONTCOVER - -import ( - "fmt" - - "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/testutil" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/tendermint/fundraising/x/fundraising/client/cli" -) - -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()), -} - -// MsgCreateFixedPriceAuctionExec creates a transaction for creating a fixed price auction. -func MsgCreateFixedPriceAuctionExec(clientCtx client.Context, - from string, - file string, - extraArgs ...string, -) (testutil.BufferWriter, error) { - - args := append([]string{ - file, - fmt.Sprintf("--%s=%s", flags.FlagFrom, from), - }, commonArgs...) - - args = append(args, commonArgs...) - args = append(args, extraArgs...) - - return clitestutil.ExecTestCLICmd(clientCtx, cli.NewCreateFixedPriceAuctionCmd(), args) -} - -// MsgCreateBatchAuctionExec creates a transaction for creating a batch auction. -func MsgCreateBatchAuctionExec(clientCtx client.Context, - from string, - file string, - extraArgs ...string, -) (testutil.BufferWriter, error) { - - args := append([]string{ - file, - fmt.Sprintf("--%s=%s", flags.FlagFrom, from), - }, commonArgs...) - - args = append(args, commonArgs...) - args = append(args, extraArgs...) - - return clitestutil.ExecTestCLICmd(clientCtx, cli.NewCreateBatchAuctionCmd(), args) -} - -// MsgPlaceBidExec creates a transaction for placing a bid. -func MsgPlaceBidExec(clientCtx client.Context, - from string, - auctionId uint64, - bidType string, - price sdk.Dec, - coin sdk.Coin, - extraArgs ...string, -) (testutil.BufferWriter, error) { - - args := append([]string{ - fmt.Sprint(auctionId), - bidType, - price.String(), - coin.String(), - fmt.Sprintf("--%s=%s", flags.FlagFrom, from), - }, commonArgs...) - - args = append(args, commonArgs...) - args = append(args, extraArgs...) - - return clitestutil.ExecTestCLICmd(clientCtx, cli.NewPlaceBidCmd(), args) -} - -// MsgAddAllowedBidderExec creates a transaction for adding an allowed bidder. -func MsgAddAllowedBidderExec(clientCtx client.Context, - from string, - auctionId uint64, - maxBidAmt math.Int, - extraArgs ...string, -) (testutil.BufferWriter, error) { - - args := append([]string{ - fmt.Sprint(auctionId), - from, - maxBidAmt.String(), - fmt.Sprintf("--%s=%s", flags.FlagFrom, from), - }, commonArgs...) - - args = append(args, commonArgs...) - args = append(args, extraArgs...) - - return clitestutil.ExecTestCLICmd(clientCtx, cli.NewAddAllowedBidderCmd(), args) -} diff --git a/x/fundraising/client/testutil/suite_test.go b/x/fundraising/client/testutil/suite_test.go deleted file mode 100644 index ce50fc52..00000000 --- a/x/fundraising/client/testutil/suite_test.go +++ /dev/null @@ -1,1316 +0,0 @@ -package testutil - -import ( - "fmt" - "strconv" - "time" - - tmdb "github.com/cometbft/cometbft-db" - tmcli "github.com/cometbft/cometbft/libs/cli" - tmrand "github.com/cometbft/cometbft/libs/rand" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/crypto/hd" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - servertypes "github.com/cosmos/cosmos-sdk/server/types" - pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types" - "github.com/cosmos/cosmos-sdk/testutil" - utilcli "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/cosmos/cosmos-sdk/testutil/network" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/gogo/protobuf/proto" - "github.com/stretchr/testify/suite" - - chain "github.com/tendermint/fundraising/app" - "github.com/tendermint/fundraising/cmd" - "github.com/tendermint/fundraising/x/fundraising/client/cli" - "github.com/tendermint/fundraising/x/fundraising/keeper" - "github.com/tendermint/fundraising/x/fundraising/types" -) - -type TxCmdTestSuite struct { - suite.Suite - - cfg network.Config - network *network.Network - - denom1 string - denom2 string -} - -// SetupTest creates a new network for _each_ integration test. We create a new -// network for each test because there are some state modifications that are -// needed to be made in order to make useful queries. However, we don't want -// these state changes to be present in other tests. -func (s *TxCmdTestSuite) SetupTest() { - s.T().Log("setting up integration test suite") - - keeper.EnableAddAllowedBidder = true - - s.cfg = DefaultConfig() - var err error - s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) - s.Require().NoError(err) - s.denom1, s.denom2 = fmt.Sprintf("%stoken", s.network.Validators[0].Moniker), s.cfg.BondDenom - - h, err := s.network.WaitForHeight(1) - s.Require().NoError(err, "stalled at height %d", h) -} - -// TearDownTest cleans up the current test network after each test in the suite. -func (s *TxCmdTestSuite) TearDownTest() { - s.T().Log("tearing down integration test suite") - s.network.Cleanup() -} - -func (s *TxCmdTestSuite) TestNewCreateFixedAmountPlanCmd() { - val := s.network.Validators[0] - - startTime := time.Now() - endTime := startTime.AddDate(0, 1, 0) - s.Require().NoError(s.network.WaitForNextBlock()) - - testCases := []struct { - name string - args []string - expectErr bool - respType proto.Message - expectedCode uint32 - }{ - { - "valid case", - []string{ - testutil.WriteToNewTempFile(s.T(), cli.FixedPriceAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("1.0"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: endTime.AddDate(0, 3, 0), - Weight: sdk.MustNewDecFromStr("1.0"), - }, - }, - StartTime: startTime, - EndTime: endTime, - }.String()).Name(), - 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, &sdk.TxResponse{}, 0, - }, - { - "invalid case #1: invalid end time", - []string{ - testutil.WriteToNewTempFile(s.T(), cli.FixedPriceAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("1.0"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: endTime.AddDate(0, 3, 0), - Weight: sdk.MustNewDecFromStr("1.0"), - }, - }, - StartTime: startTime, - EndTime: startTime, - }.String()).Name(), - 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, &sdk.TxResponse{}, 1, - }, - { - "invalid case #2: invalid vesting schedule", - []string{ - testutil.WriteToNewTempFile(s.T(), cli.FixedPriceAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("1.0"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: startTime, - Weight: sdk.MustNewDecFromStr("1.0"), - }, - }, - StartTime: startTime, - EndTime: endTime, - }.String()).Name(), - 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, &sdk.TxResponse{}, 1, - }, - { - "invalid case #3: invalid vesting schedule", - []string{ - testutil.WriteToNewTempFile(s.T(), cli.FixedPriceAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("1.0"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: endTime.AddDate(0, 3, 0), - Weight: sdk.MustNewDecFromStr("5.0"), - }, - }, - StartTime: startTime, - EndTime: endTime, - }.String()).Name(), - 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, &sdk.TxResponse{}, 1, - }, - { - "invalid case #4: invalid vesting schedule", - []string{ - testutil.WriteToNewTempFile(s.T(), cli.FixedPriceAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("1.0"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: endTime.AddDate(0, 3, 0), - Weight: sdk.MustNewDecFromStr("0.5"), - }, - { - ReleaseTime: endTime.AddDate(0, 6, 0), - Weight: sdk.MustNewDecFromStr("0.51"), - }, - }, - StartTime: startTime, - EndTime: endTime, - }.String()).Name(), - 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, &sdk.TxResponse{}, 1, - }, - { - "invalid case #5: invalid vesting schedule", - []string{ - testutil.WriteToNewTempFile(s.T(), cli.FixedPriceAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("1.0"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: endTime.AddDate(0, 3, 0), - Weight: sdk.MustNewDecFromStr("0.5"), - }, - { - ReleaseTime: endTime.AddDate(0, 3, 0), - Weight: sdk.MustNewDecFromStr("0.5"), - }, - }, - StartTime: startTime, - EndTime: endTime, - }.String()).Name(), - 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, &sdk.TxResponse{}, 1, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.NewCreateFixedPriceAuctionCmd() - clientCtx := val.ClientCtx - - out, err := utilcli.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err, out.String()) - - var resp sdk.TxResponse - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp)) - s.Require().NoError(utilcli.CheckTxCode(s.network, clientCtx, resp.TxHash, tc.expectedCode)) - } - }) - } -} - -func (s *TxCmdTestSuite) TestNewCreateBatchAuctionCmd() { - val := s.network.Validators[0] - - startTime := time.Now() - endTime := startTime.AddDate(0, 1, 0) - s.Require().NoError(s.network.WaitForNextBlock()) - - testCases := []struct { - name string - args []string - expectErr bool - respType proto.Message - expectedCode uint32 - }{ - { - "valid case", - []string{ - testutil.WriteToNewTempFile(s.T(), cli.BatchAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("0.5"), - MinBidPrice: sdk.MustNewDecFromStr("0.1"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - MaxExtendedRound: 2, - ExtendedRoundRate: sdk.MustNewDecFromStr("0.15"), - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: endTime.AddDate(0, 3, 0), - Weight: sdk.MustNewDecFromStr("1.0"), - }, - }, - StartTime: startTime, - EndTime: endTime, - }.String()).Name(), - 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, &sdk.TxResponse{}, 0, - }, - { - "invalid case #1: invalid end time", - []string{ - testutil.WriteToNewTempFile(s.T(), cli.BatchAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("0.5"), - MinBidPrice: sdk.MustNewDecFromStr("0.1"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - MaxExtendedRound: 2, - ExtendedRoundRate: sdk.MustNewDecFromStr("0.15"), - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: endTime.AddDate(0, 3, 0), - Weight: sdk.MustNewDecFromStr("1.0"), - }, - }, - StartTime: startTime, - EndTime: startTime, - }.String()).Name(), - 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, &sdk.TxResponse{}, 1, - }, - { - "invalid case #2: invalid vesting schedule", - []string{ - testutil.WriteToNewTempFile(s.T(), cli.BatchAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("0.5"), - MinBidPrice: sdk.MustNewDecFromStr("0.1"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - MaxExtendedRound: 2, - ExtendedRoundRate: sdk.MustNewDecFromStr("0.15"), - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: startTime, - Weight: sdk.MustNewDecFromStr("1.0"), - }, - }, - StartTime: startTime, - EndTime: startTime, - }.String()).Name(), - 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, &sdk.TxResponse{}, 1, - }, - { - "invalid case #3: invalid vesting schedule", - []string{ - testutil.WriteToNewTempFile(s.T(), cli.BatchAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("0.5"), - MinBidPrice: sdk.MustNewDecFromStr("0.1"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - MaxExtendedRound: 2, - ExtendedRoundRate: sdk.MustNewDecFromStr("0.15"), - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: endTime.AddDate(0, 3, 0), - Weight: sdk.MustNewDecFromStr("5.0"), - }, - }, - StartTime: startTime, - EndTime: startTime, - }.String()).Name(), - 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, &sdk.TxResponse{}, 1, - }, - { - "invalid case #4: invalid vesting schedule", - []string{ - testutil.WriteToNewTempFile(s.T(), cli.BatchAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("0.5"), - MinBidPrice: sdk.MustNewDecFromStr("0.1"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - MaxExtendedRound: 2, - ExtendedRoundRate: sdk.MustNewDecFromStr("0.15"), - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: endTime.AddDate(0, 3, 0), - Weight: sdk.MustNewDecFromStr("0.5"), - }, - { - ReleaseTime: endTime.AddDate(0, 6, 0), - Weight: sdk.MustNewDecFromStr("0.51"), - }, - }, - StartTime: startTime, - EndTime: startTime, - }.String()).Name(), - 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, &sdk.TxResponse{}, 1, - }, - { - "invalid case #5: invalid vesting schedule", - []string{ - testutil.WriteToNewTempFile(s.T(), cli.BatchAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("0.5"), - MinBidPrice: sdk.MustNewDecFromStr("0.1"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - MaxExtendedRound: 2, - ExtendedRoundRate: sdk.MustNewDecFromStr("0.15"), - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: endTime.AddDate(0, 3, 0), - Weight: sdk.MustNewDecFromStr("0.5"), - }, - { - ReleaseTime: endTime.AddDate(0, 3, 0), - Weight: sdk.MustNewDecFromStr("0.5"), - }, - }, - StartTime: startTime, - EndTime: startTime, - }.String()).Name(), - 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, &sdk.TxResponse{}, 1, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.NewCreateBatchAuctionCmd() - clientCtx := val.ClientCtx - - out, err := utilcli.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err, out.String()) - - var resp sdk.TxResponse - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp)) - s.Require().NoError(utilcli.CheckTxCode(s.network, clientCtx, resp.TxHash, tc.expectedCode)) - } - }) - } -} - -func (s *TxCmdTestSuite) TestNewCancelAuctionCmd() { - val := s.network.Validators[0] - - // Create a fixed price auction - _, err := MsgCreateFixedPriceAuctionExec( - val.ClientCtx, - val.Address.String(), - testutil.WriteToNewTempFile(s.T(), cli.FixedPriceAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("1.0"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: time.Now().AddDate(1, 0, 0), - Weight: sdk.MustNewDecFromStr("1.0"), - }, - }, - StartTime: time.Now().AddDate(0, 1, 0), - EndTime: time.Now().AddDate(0, 3, 0), - }.String()).Name(), - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - testCases := []struct { - name string - args []string - expectErr bool - respType proto.Message - expectedCode uint32 - }{ - { - "valid case", - []string{ - fmt.Sprint(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.NewInt64Coin(s.cfg.BondDenom, 10)).String()), - }, - false, &sdk.TxResponse{}, 0, - }, - { - "invalid case #1: auction not found", - []string{ - fmt.Sprint(5), - 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.NewInt64Coin(s.cfg.BondDenom, 10)).String()), - }, - false, &sdk.TxResponse{}, 38, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.NewCancelAuctionCmd() - clientCtx := val.ClientCtx - - out, err := utilcli.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err, out.String()) - - var resp sdk.TxResponse - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp)) - s.Require().NoError(utilcli.CheckTxCode(s.network, clientCtx, resp.TxHash, tc.expectedCode)) - } - }) - } -} - -func (s *TxCmdTestSuite) TestNewPlaceBidCmd() { - val := s.network.Validators[0] - - // Create a fixed price auction - _, err := MsgCreateFixedPriceAuctionExec( - val.ClientCtx, - val.Address.String(), - testutil.WriteToNewTempFile(s.T(), cli.FixedPriceAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("1.0"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: time.Now().AddDate(0, 6, 0), - Weight: sdk.MustNewDecFromStr("1.0"), - }, - }, - StartTime: time.Now(), - EndTime: time.Now().AddDate(0, 3, 0), - }.String()).Name(), - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - // Add allowed bidder - _, err = MsgAddAllowedBidderExec( - val.ClientCtx, - val.Address.String(), - 1, - sdk.NewInt(100_000_000), - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - testCases := []struct { - name string - args []string - expectErr bool - respType proto.Message - expectedCode uint32 - }{ - { - "valid case", - []string{ - fmt.Sprint(1), - "fixed-price", - sdk.MustNewDecFromStr("1.0").String(), - sdk.NewCoin(s.denom2, sdk.NewInt(50_000_000)).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.NewInt64Coin(s.cfg.BondDenom, 10)).String()), - }, - false, &sdk.TxResponse{}, 0, - }, - { - "invalid case #1: incorrect auction type", - []string{ - fmt.Sprint(1), - "batch-worth", - sdk.MustNewDecFromStr("1.0").String(), - sdk.NewCoin(s.denom2, sdk.NewInt(50_000_000)).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.NewInt64Coin(s.cfg.BondDenom, 10)).String()), - }, - false, &sdk.TxResponse{}, 7, - }, - { - "invalid case #2: incorrect auction type", - []string{ - fmt.Sprint(1), - "batch-many", - sdk.MustNewDecFromStr("1.0").String(), - sdk.NewCoin(s.denom2, sdk.NewInt(50_000_000)).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.NewInt64Coin(s.cfg.BondDenom, 10)).String()), - }, - false, &sdk.TxResponse{}, 7, - }, - { - "invalid case #3: incorrect start price", - []string{ - fmt.Sprint(1), - "fixed-price", - sdk.MustNewDecFromStr("0.1").String(), - sdk.NewCoin(s.denom2, sdk.NewInt(50_000_000)).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.NewInt64Coin(s.cfg.BondDenom, 10)).String()), - }, - false, &sdk.TxResponse{}, 3, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.NewPlaceBidCmd() - clientCtx := val.ClientCtx - - out, err := utilcli.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err, out.String()) - - var resp sdk.TxResponse - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp)) - s.Require().NoError(utilcli.CheckTxCode(s.network, clientCtx, resp.TxHash, tc.expectedCode)) - } - }) - } -} - -func (s *TxCmdTestSuite) TestNewModifyBidCmd() { - val := s.network.Validators[0] - - // Create a batch auction - _, err := MsgCreateBatchAuctionExec( - val.ClientCtx, - val.Address.String(), - testutil.WriteToNewTempFile(s.T(), cli.BatchAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("0.5"), - MinBidPrice: sdk.MustNewDecFromStr("0.1"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - MaxExtendedRound: 2, - ExtendedRoundRate: sdk.MustNewDecFromStr("0.2"), - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: time.Now().AddDate(0, 6, 0), - Weight: sdk.MustNewDecFromStr("1.0"), - }, - }, - StartTime: time.Now(), - EndTime: time.Now().AddDate(0, 3, 0), - }.String()).Name(), - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - // Add allowed bidder - _, err = MsgAddAllowedBidderExec( - val.ClientCtx, - val.Address.String(), - 1, - sdk.NewInt(100_000_000), - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - // Place a bid - _, err = MsgPlaceBidExec( - val.ClientCtx, - val.Address.String(), - 1, - "batch-worth", - sdk.MustNewDecFromStr("0.55"), - sdk.NewCoin(s.denom2, sdk.NewInt(50_000_000)), - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - testCases := []struct { - name string - args []string - expectErr bool - respType proto.Message - expectedCode uint32 - }{ - { - "valid case", - []string{ - fmt.Sprint(1), - fmt.Sprint(1), - sdk.MustNewDecFromStr("0.6").String(), - sdk.NewCoin(s.denom2, sdk.NewInt(50_000_000)).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.NewInt64Coin(s.cfg.BondDenom, 10)).String()), - }, - false, &sdk.TxResponse{}, 0, - }, - { - "invalid case #1: bid price and coin amount must be changed", - []string{ - fmt.Sprint(1), - fmt.Sprint(1), - sdk.MustNewDecFromStr("0.5").String(), - sdk.NewCoin(s.denom2, sdk.NewInt(50_000_000)).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.NewInt64Coin(s.cfg.BondDenom, 10)).String()), - }, - false, &sdk.TxResponse{}, 18, - }, - { - "invalid case #2: bid not found", - []string{ - fmt.Sprint(1), - fmt.Sprint(5), - sdk.MustNewDecFromStr("0.5").String(), - sdk.NewCoin(s.denom2, sdk.NewInt(50_000_000)).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.NewInt64Coin(s.cfg.BondDenom, 10)).String()), - }, - false, &sdk.TxResponse{}, 38, - }, - { - "invalid case #3: min bid price", - []string{ - fmt.Sprint(1), - fmt.Sprint(1), - sdk.MustNewDecFromStr("0.05").String(), - sdk.NewCoin(s.denom2, sdk.NewInt(50_000_000)).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.NewInt64Coin(s.cfg.BondDenom, 10)).String()), - }, - false, &sdk.TxResponse{}, 13, - }, - { - "invalid case #4: incorrect denom", - []string{ - fmt.Sprint(1), - fmt.Sprint(1), - sdk.MustNewDecFromStr("0.6").String(), - sdk.NewCoin(s.denom1, sdk.NewInt(50_000_000)).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.NewInt64Coin(s.cfg.BondDenom, 10)).String()), - }, - false, &sdk.TxResponse{}, 8, - }, - { - "invalid case #5: bid price or coin amount cannot be lower", - []string{ - fmt.Sprint(1), - fmt.Sprint(1), - sdk.MustNewDecFromStr("0.2").String(), - sdk.NewCoin(s.denom2, sdk.NewInt(50_000_000)).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.NewInt64Coin(s.cfg.BondDenom, 10)).String()), - }, - false, &sdk.TxResponse{}, 18, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - var ( - clientCtx = val.ClientCtx - cmd = cli.NewModifyBidCmd() - ) - out, err := utilcli.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err, out.String()) - - var resp sdk.TxResponse - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp)) - s.Require().NoError(utilcli.CheckTxCode(s.network, clientCtx, resp.TxHash, tc.expectedCode)) - } - }) - } -} - -type QueryCmdTestSuite struct { - suite.Suite - - cfg network.Config - network *network.Network - - denom1 string - denom2 string -} - -func (s *QueryCmdTestSuite) SetupTest() { - s.T().Log("setting up integration test suite") - - keeper.EnableAddAllowedBidder = true - - s.cfg = DefaultConfig() - s.cfg.NumValidators = 2 - var err error - s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) - s.Require().NoError(err) - s.denom1, s.denom2 = fmt.Sprintf("%stoken", s.network.Validators[0].Moniker), s.cfg.BondDenom - - _, err = s.network.WaitForHeight(1) - s.Require().NoError(err) -} - -func (s *QueryCmdTestSuite) TearDownSuite() { - s.T().Log("tearing down integration test suite") - s.network.Cleanup() -} - -func (s *QueryCmdTestSuite) TestNewQueryParamsCmd() { - val := s.network.Validators[0] - clientCtx := val.ClientCtx - - testCases := []struct { - name string - args []string - expectErr bool - }{ - { - "happy case", - []string{fmt.Sprintf("--%s=json", tmcli.OutputFlag)}, - false, - }, - { - "with specific height", - []string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=json", tmcli.OutputFlag)}, - false, - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.NewQueryParamsCmd() - - out, err := utilcli.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - s.Require().NotEqual("internal", err.Error()) - } else { - s.Require().NoError(err) - - var params types.Params - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), ¶ms)) - s.Require().NotEmpty(params.AuctionCreationFee) - } - }) - } -} - -func (s *TxCmdTestSuite) TestNewQueryAuctionsCmd() { - val := s.network.Validators[0] - clientCtx := val.ClientCtx - types.RegisterInterfaces(clientCtx.InterfaceRegistry) - - // Create a fixed price auction - _, err := MsgCreateFixedPriceAuctionExec( - val.ClientCtx, - val.Address.String(), - testutil.WriteToNewTempFile(s.T(), cli.FixedPriceAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("1.0"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: time.Now().AddDate(1, 0, 0), - Weight: sdk.MustNewDecFromStr("1.0"), - }, - }, - StartTime: time.Now().AddDate(0, 1, 0), - EndTime: time.Now().AddDate(0, 3, 0), - }.String()).Name(), - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - // Create a batch auction - _, err = MsgCreateBatchAuctionExec( - val.ClientCtx, - val.Address.String(), - testutil.WriteToNewTempFile(s.T(), cli.BatchAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("0.5"), - MinBidPrice: sdk.MustNewDecFromStr("0.1"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - MaxExtendedRound: 2, - ExtendedRoundRate: sdk.MustNewDecFromStr("0.2"), - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: time.Now().AddDate(0, 6, 0), - Weight: sdk.MustNewDecFromStr("1.0"), - }, - }, - StartTime: time.Now(), - EndTime: time.Now().AddDate(0, 3, 0), - }.String()).Name(), - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - for _, tc := range []struct { - name string - args []string - expectedErr string - postRun func(resp types.QueryAuctionsResponse) - }{ - { - "happy case", - []string{fmt.Sprintf("--%s=json", tmcli.OutputFlag)}, - "", - func(resp types.QueryAuctionsResponse) { - s.Require().Len(resp.Auctions, 2) - }, - }, - } { - s.Run(tc.name, func() { - cmd := cli.NewQueryAuctionsCmd() - - out, err := utilcli.ExecTestCLICmd(val.ClientCtx, cmd, tc.args) - - if tc.expectedErr == "" { - s.Require().NoError(err) - var resp types.QueryAuctionsResponse - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) - tc.postRun(resp) - } else { - s.Require().EqualError(err, tc.expectedErr) - } - }) - } -} - -func (s *TxCmdTestSuite) TestNewQueryAuctionCmd() { - val := s.network.Validators[0] - clientCtx := val.ClientCtx - types.RegisterInterfaces(clientCtx.InterfaceRegistry) - - // Create a fixed price auction - _, err := MsgCreateFixedPriceAuctionExec( - val.ClientCtx, - val.Address.String(), - testutil.WriteToNewTempFile(s.T(), cli.FixedPriceAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("1.0"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: time.Now().AddDate(1, 0, 0), - Weight: sdk.MustNewDecFromStr("1.0"), - }, - }, - StartTime: time.Now().AddDate(0, 1, 0), - EndTime: time.Now().AddDate(0, 3, 0), - }.String()).Name(), - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - for _, tc := range []struct { - name string - args []string - expectedErr string - postRun func(resp types.QueryAuctionResponse) - }{ - { - "happy case", - []string{ - strconv.Itoa(1), - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - }, - "", - func(resp types.QueryAuctionResponse) { - auction, err := types.UnpackAuction(resp.Auction) - s.Require().NoError(err) - s.Require().Equal(types.AuctionTypeFixedPrice, auction.GetType()) - }, - }, - } { - s.Run(tc.name, func() { - cmd := cli.NewQueryAuctionCmd() - out, err := utilcli.ExecTestCLICmd(val.ClientCtx, cmd, tc.args) - - if tc.expectedErr == "" { - s.Require().NoError(err) - var resp types.QueryAuctionResponse - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) - tc.postRun(resp) - return - } - s.Require().EqualError(err, tc.expectedErr) - }) - } -} - -func (s *TxCmdTestSuite) TestNewQueryAllowedBiddersCmd() { - val := s.network.Validators[0] - clientCtx := val.ClientCtx - types.RegisterInterfaces(clientCtx.InterfaceRegistry) - - // Create a fixed price auction - _, err := MsgCreateFixedPriceAuctionExec( - val.ClientCtx, - val.Address.String(), - testutil.WriteToNewTempFile(s.T(), cli.FixedPriceAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("1.0"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: time.Now().AddDate(1, 0, 0), - Weight: sdk.MustNewDecFromStr("1.0"), - }, - }, - StartTime: time.Now().AddDate(0, 1, 0), - EndTime: time.Now().AddDate(0, 3, 0), - }.String()).Name(), - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - // Add allowed bidder - _, err = MsgAddAllowedBidderExec( - val.ClientCtx, - val.Address.String(), - 1, - sdk.NewInt(100_000_000), - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - for _, tc := range []struct { - name string - args []string - expectedErr string - postRun func(resp types.QueryAllowedBiddersResponse) - }{ - { - "happy case", - []string{ - strconv.Itoa(1), - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - }, - "", - func(resp types.QueryAllowedBiddersResponse) { - s.Require().Len(resp.AllowedBidders, 1) - }, - }, - } { - s.Run(tc.name, func() { - cmd := cli.NewQueryAllowedBiddersCmd() - out, err := utilcli.ExecTestCLICmd(val.ClientCtx, cmd, tc.args) - - if tc.expectedErr == "" { - s.Require().NoError(err) - var resp types.QueryAllowedBiddersResponse - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) - tc.postRun(resp) - return - } - s.Require().EqualError(err, tc.expectedErr) - }) - } -} - -func (s *TxCmdTestSuite) TestNewQueryAllowedBidderCmd() { - val := s.network.Validators[0] - clientCtx := val.ClientCtx - types.RegisterInterfaces(clientCtx.InterfaceRegistry) - - // Create a fixed price auction - _, err := MsgCreateFixedPriceAuctionExec( - val.ClientCtx, - val.Address.String(), - testutil.WriteToNewTempFile(s.T(), cli.FixedPriceAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("1.0"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: time.Now().AddDate(1, 0, 0), - Weight: sdk.MustNewDecFromStr("1.0"), - }, - }, - StartTime: time.Now().AddDate(0, 1, 0), - EndTime: time.Now().AddDate(0, 3, 0), - }.String()).Name(), - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - // Add allowed bidder - maxBidAmt := sdk.NewInt(100_000_000) - _, err = MsgAddAllowedBidderExec( - val.ClientCtx, - val.Address.String(), - 1, - maxBidAmt, - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - for _, tc := range []struct { - name string - args []string - expectedErr string - postRun func(resp types.QueryAllowedBidderResponse) - }{ - { - "happy case", - []string{ - strconv.Itoa(1), - val.Address.String(), - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - }, - "", - func(resp types.QueryAllowedBidderResponse) { - s.Require().Equal(val.Address.String(), resp.AllowedBidder.Bidder) - s.Require().Equal(maxBidAmt, resp.AllowedBidder.MaxBidAmount) - }, - }, - } { - s.Run(tc.name, func() { - cmd := cli.NewQueryAllowedBidderCmd() - out, err := utilcli.ExecTestCLICmd(val.ClientCtx, cmd, tc.args) - - if tc.expectedErr == "" { - s.Require().NoError(err) - var resp types.QueryAllowedBidderResponse - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) - tc.postRun(resp) - } else { - s.Require().EqualError(err, tc.expectedErr) - } - }) - } -} - -func (s *TxCmdTestSuite) TestNewQueryBidsCmd() { - val := s.network.Validators[0] - clientCtx := val.ClientCtx - types.RegisterInterfaces(clientCtx.InterfaceRegistry) - - // Create a batch auction - _, err := MsgCreateBatchAuctionExec( - val.ClientCtx, - val.Address.String(), - testutil.WriteToNewTempFile(s.T(), cli.BatchAuctionRequest{ - StartPrice: sdk.MustNewDecFromStr("0.5"), - MinBidPrice: sdk.MustNewDecFromStr("0.1"), - SellingCoin: sdk.NewInt64Coin(s.denom1, 100_000_000_000), - PayingCoinDenom: s.denom2, - MaxExtendedRound: 2, - ExtendedRoundRate: sdk.MustNewDecFromStr("0.2"), - VestingSchedules: []types.VestingSchedule{ - { - ReleaseTime: time.Now().AddDate(0, 6, 0), - Weight: sdk.MustNewDecFromStr("1.0"), - }, - }, - StartTime: time.Now(), - EndTime: time.Now().AddDate(0, 3, 0), - }.String()).Name(), - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - // Add allowed bidder - _, err = MsgAddAllowedBidderExec( - val.ClientCtx, - val.Address.String(), - 1, - sdk.NewInt(100_000_000), - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - // Place a bid #1 - _, err = MsgPlaceBidExec( - val.ClientCtx, - val.Address.String(), - 1, - "batch-worth", - sdk.MustNewDecFromStr("0.55"), - sdk.NewCoin(s.denom2, sdk.NewInt(20_000_000)), - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - // Place a bid #2 - _, err = MsgPlaceBidExec( - val.ClientCtx, - val.Address.String(), - 1, - "batch-many", - sdk.MustNewDecFromStr("0.6"), - sdk.NewCoin(s.denom1, sdk.NewInt(5_000_000)), - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - for _, tc := range []struct { - name string - args []string - expectedErr string - postRun func(resp types.QueryBidsResponse) - }{ - { - "happy case", - []string{ - strconv.Itoa(1), - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - }, - "", - func(resp types.QueryBidsResponse) { - s.Require().Len(resp.Bids, 2) - }, - }, - } { - s.Run(tc.name, func() { - cmd := cli.NewQueryBidsCmd() - - out, err := utilcli.ExecTestCLICmd(val.ClientCtx, cmd, tc.args) - - if tc.expectedErr == "" { - s.Require().NoError(err) - var resp types.QueryBidsResponse - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) - tc.postRun(resp) - } else { - s.Require().EqualError(err, tc.expectedErr) - } - }) - } -} - -// DefaultConfig will initialize config for the network with custom application, -// genesis and single validator. All other parameters are inherited from cosmos-sdk/testutil/network.DefaultConfig -func DefaultConfig() network.Config { - var ( - encoding = cmd.MakeEncodingConfig(chain.ModuleBasics) - chainID = "chain-" + tmrand.NewRand().Str(6) - ) - return network.Config{ - Codec: encoding.Marshaler, - TxConfig: encoding.TxConfig, - LegacyAmino: encoding.Amino, - InterfaceRegistry: encoding.InterfaceRegistry, - AccountRetriever: authtypes.AccountRetriever{}, - AppConstructor: func(val network.ValidatorI) servertypes.Application { - return chain.New( - val.GetCtx().Logger, - tmdb.NewMemDB(), - nil, - true, - map[int64]bool{}, - val.GetCtx().Config.RootDir, - 0, - encoding, - simtestutil.EmptyAppOptions{}, - baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.GetAppConfig().Pruning)), - baseapp.SetMinGasPrices(val.GetAppConfig().MinGasPrices), - baseapp.SetChainID(chainID), - ) - }, - GenesisState: chain.ModuleBasics.DefaultGenesis(encoding.Marshaler), - TimeoutCommit: 2 * time.Second, - ChainID: chainID, - NumValidators: 1, - BondDenom: sdk.DefaultBondDenom, - MinGasPrices: fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), - AccountTokens: sdk.NewInt(100_000_000_000_000), // node0token denom, - StakingTokens: sdk.NewInt(100_000_000_000_000), // stake denom - BondedTokens: sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction), - PruningStrategy: pruningtypes.PruningOptionNothing, - CleanupDir: true, - SigningAlgo: string(hd.Secp256k1Type), - KeyringOptions: []keyring.Option{}, - } -} diff --git a/x/fundraising/handler.go b/x/fundraising/handler.go deleted file mode 100644 index 9541fb73..00000000 --- a/x/fundraising/handler.go +++ /dev/null @@ -1,49 +0,0 @@ -package fundraising - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - "github.com/tendermint/fundraising/x/fundraising/keeper" - "github.com/tendermint/fundraising/x/fundraising/types" -) - -// NewHandler returns a new msg handler. -func NewHandler(k keeper.Keeper) sdk.Handler { - msgServer := keeper.NewMsgServerImpl(k) - - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - ctx = ctx.WithEventManager(sdk.NewEventManager()) - - switch msg := msg.(type) { - case *types.MsgCreateFixedPriceAuction: - res, err := msgServer.CreateFixedPriceAuction(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - - case *types.MsgCreateBatchAuction: - res, err := msgServer.CreateBatchAuction(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - - case *types.MsgCancelAuction: - res, err := msgServer.CancelAuction(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - - case *types.MsgPlaceBid: - res, err := msgServer.PlaceBid(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - - case *types.MsgModifyBid: - res, err := msgServer.ModifyBid(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - - case *types.MsgAddAllowedBidder: - res, err := msgServer.AddAllowedBidder(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - - default: - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg)) - } - } -} diff --git a/x/fundraising/abci.go b/x/fundraising/keeper/abci.go similarity index 52% rename from x/fundraising/abci.go rename to x/fundraising/keeper/abci.go index 55602811..dc49f95a 100644 --- a/x/fundraising/abci.go +++ b/x/fundraising/keeper/abci.go @@ -1,29 +1,34 @@ -package fundraising +package keeper import ( + "context" + "fmt" "time" "github.com/cosmos/cosmos-sdk/telemetry" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/tendermint/fundraising/x/fundraising/keeper" "github.com/tendermint/fundraising/x/fundraising/types" ) -func BeginBlocker(ctx sdk.Context, k keeper.Keeper) { +func (k Keeper) BeginBlocker(ctx context.Context) error { defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) // Get all auctions from the store and execute operations depending on auction status. - for _, auction := range k.GetAuctions(ctx) { + auctions, err := k.Auctions(ctx) + if err != nil { + return err + } + for _, auction := range auctions { switch auction.GetStatus() { case types.AuctionStatusStandBy: - k.ExecuteStandByStatus(ctx, auction) + err = k.ExecuteStandByStatus(ctx, auction) case types.AuctionStatusStarted: - k.ExecuteStartedStatus(ctx, auction) + err = k.ExecuteStartedStatus(ctx, auction) case types.AuctionStatusVesting: - k.ExecuteVestingStatus(ctx, auction) + err = k.ExecuteVestingStatus(ctx, auction) default: - continue + err = fmt.Errorf("invalid auction status %s", auction.GetStatus()) } } + return err } diff --git a/x/fundraising/keeper/allowed_bidder.go b/x/fundraising/keeper/allowed_bidder.go new file mode 100644 index 00000000..af5018c7 --- /dev/null +++ b/x/fundraising/keeper/allowed_bidder.go @@ -0,0 +1,40 @@ +package keeper + +import ( + "context" + + "cosmossdk.io/collections" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/tendermint/fundraising/x/fundraising/types" +) + +// GetAllowedBiddersByAuction returns allowed bidders list for the auction. +func (k Keeper) GetAllowedBiddersByAuction(ctx context.Context, auctionId uint64) ([]types.AllowedBidder, error) { + allowedBidders := make([]types.AllowedBidder, 0) + rng := collections.NewPrefixedPairRange[uint64, sdk.AccAddress](auctionId) + err := k.AllowedBidder.Walk(ctx, rng, func(_ collections.Pair[uint64, sdk.AccAddress], allowedBidder types.AllowedBidder) (bool, error) { + allowedBidders = append(allowedBidders, allowedBidder) + return false, nil + }) + return allowedBidders, err +} + +// AllowedBidders returns all AllowedBidder. +func (k Keeper) AllowedBidders(ctx context.Context) ([]types.AllowedBidder, error) { + allowedBidders := make([]types.AllowedBidder, 0) + err := k.IterateAllowedBidders(ctx, func(_ collections.Pair[uint64, sdk.AccAddress], allowedBidder types.AllowedBidder) (bool, error) { + allowedBidders = append(allowedBidders, allowedBidder) + return false, nil + }) + return allowedBidders, err +} + +// IterateAllowedBidders iterates over all the AllowedBidders and performs a callback function. +func (k Keeper) IterateAllowedBidders(ctx context.Context, cb func(collections.Pair[uint64, sdk.AccAddress], types.AllowedBidder) (bool, error)) error { + err := k.AllowedBidder.Walk(ctx, nil, cb) + if err != nil { + return err + } + return nil +} diff --git a/x/fundraising/keeper/auction.go b/x/fundraising/keeper/auction.go index 143e6f4f..c8b8679a 100644 --- a/x/fundraising/keeper/auction.go +++ b/x/fundraising/keeper/auction.go @@ -1,275 +1,43 @@ package keeper import ( + "context" "fmt" "sort" - "strconv" "time" + "cosmossdk.io/collections" + sdkerrors "cosmossdk.io/errors" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/errors" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/tendermint/fundraising/x/fundraising/types" ) -// GetNextAuctionIdWithUpdate increments auction id by one and store it. -func (k Keeper) GetNextAuctionIdWithUpdate(ctx sdk.Context) uint64 { - id := k.GetLastAuctionId(ctx) + 1 - k.SetAuctionId(ctx, id) - return id +type inOutCoins struct { + bidder string + input banktypes.Input + outputs []banktypes.Output } -// CreateFixedPriceAuction handles types.MsgCreateFixedPriceAuction and create a fixed price auction. -// Note that the module is designed to delegate authorization to an external module to add allowed bidders for the auction. -func (k Keeper) CreateFixedPriceAuction(ctx sdk.Context, msg *types.MsgCreateFixedPriceAuction) (types.AuctionI, error) { - if ctx.BlockTime().After(msg.EndTime) { // EndTime < CurrentTime - return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "end time must be set after the current time") - } - - if len(msg.VestingSchedules) > types.MaxNumVestingSchedules { - return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "exceed maximum number of vesting schedules") - } - - nextId := k.GetNextAuctionIdWithUpdate(ctx) - - if err := k.PayCreationFee(ctx, msg.GetAuctioneer()); err != nil { - return nil, sdkerrors.Wrap(err, "failed to pay auction creation fee") - } - - if err := k.ReserveSellingCoin(ctx, nextId, msg.GetAuctioneer(), msg.SellingCoin); err != nil { - return nil, sdkerrors.Wrap(err, "failed to reserve selling coin") - } - - ba := types.NewBaseAuction( - nextId, - types.AuctionTypeFixedPrice, - msg.Auctioneer, - types.SellingReserveAddress(nextId).String(), - types.PayingReserveAddress(nextId).String(), - msg.StartPrice, - msg.SellingCoin, - msg.PayingCoinDenom, - types.VestingReserveAddress(nextId).String(), - msg.VestingSchedules, - msg.StartTime, - []time.Time{msg.EndTime}, // it is an array data type to handle BatchAuction - types.AuctionStatusStandBy, - ) - - // Update status if the start time is already passed over the current time - if ba.ShouldAuctionStarted(ctx.BlockTime()) { - _ = ba.SetStatus(types.AuctionStatusStarted) - } - - auction := types.NewFixedPriceAuction(ba, msg.SellingCoin) - - // Call hook before storing an auction - k.BeforeFixedPriceAuctionCreated( - ctx, - auction.Auctioneer, - auction.StartPrice, - auction.SellingCoin, - auction.PayingCoinDenom, - auction.VestingSchedules, - auction.StartTime, - auction.EndTimes[0], - ) - - k.SetAuction(ctx, auction) - - // Call hook after storing an auction - k.AfterFixedPriceAuctionCreated( - ctx, - auction.Id, - auction.Auctioneer, - auction.StartPrice, - auction.SellingCoin, - auction.PayingCoinDenom, - auction.VestingSchedules, - auction.StartTime, - auction.EndTimes[0], - ) - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeCreateFixedPriceAuction, - sdk.NewAttribute(types.AttributeKeyAuctionId, strconv.FormatUint(nextId, 10)), - sdk.NewAttribute(types.AttributeKeyAuctioneerAddress, auction.GetAuctioneer().String()), - sdk.NewAttribute(types.AttributeKeySellingReserveAddress, auction.GetSellingReserveAddress().String()), - sdk.NewAttribute(types.AttributeKeyPayingReserveAddress, auction.GetPayingReserveAddress().String()), - sdk.NewAttribute(types.AttributeKeyStartPrice, auction.GetStartPrice().String()), - sdk.NewAttribute(types.AttributeKeySellingCoin, auction.GetSellingCoin().String()), - sdk.NewAttribute(types.AttributeKeyPayingCoinDenom, auction.GetPayingCoinDenom()), - sdk.NewAttribute(types.AttributeKeyVestingReserveAddress, auction.GetVestingReserveAddress().String()), - sdk.NewAttribute(types.AttributeKeyRemainingSellingCoin, auction.RemainingSellingCoin.String()), - sdk.NewAttribute(types.AttributeKeyStartTime, auction.GetStartTime().String()), - sdk.NewAttribute(types.AttributeKeyEndTime, msg.EndTime.String()), - sdk.NewAttribute(types.AttributeKeyAuctionStatus, auction.GetStatus().String()), - ), +// Auctions returns all Actions. +func (k Keeper) Auctions(ctx context.Context) ([]types.AuctionI, error) { + auctions := make([]types.AuctionI, 0) + err := k.IterateAuctions(ctx, func(_ uint64, auction types.AuctionI) (bool, error) { + auctions = append(auctions, auction) + return false, nil }) - - return auction, nil + return auctions, err } -// CreateBatchAuction handles types.MsgCreateBatchAuction and create a batch auction. -// Note that the module is designed to delegate authorization to an external module to add allowed bidders for the auction. -func (k Keeper) CreateBatchAuction(ctx sdk.Context, msg *types.MsgCreateBatchAuction) (types.AuctionI, error) { - if ctx.BlockTime().After(msg.EndTime) { // EndTime < CurrentTime - return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "end time must be set after the current time") - } - - if len(msg.VestingSchedules) > types.MaxNumVestingSchedules { - return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "exceed maximum number of vesting schedules") - } - - if msg.MaxExtendedRound > types.MaxExtendedRound { - return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "exceed maximum extended round") - } - - nextId := k.GetNextAuctionIdWithUpdate(ctx) - - if err := k.PayCreationFee(ctx, msg.GetAuctioneer()); err != nil { - return nil, sdkerrors.Wrap(err, "failed to pay auction creation fee") - } - - if err := k.ReserveSellingCoin(ctx, nextId, msg.GetAuctioneer(), msg.SellingCoin); err != nil { - return nil, sdkerrors.Wrap(err, "failed to reserve selling coin") - } - - endTimes := []time.Time{msg.EndTime} // it is an array data type to handle BatchAuction - - ba := types.NewBaseAuction( - nextId, - types.AuctionTypeBatch, - msg.Auctioneer, - types.SellingReserveAddress(nextId).String(), - types.PayingReserveAddress(nextId).String(), - msg.StartPrice, - msg.SellingCoin, - msg.PayingCoinDenom, - types.VestingReserveAddress(nextId).String(), - msg.VestingSchedules, - msg.StartTime, - endTimes, - types.AuctionStatusStandBy, - ) - - // Update status if the start time is already passed the current time - if ba.ShouldAuctionStarted(ctx.BlockTime()) { - _ = ba.SetStatus(types.AuctionStatusStarted) - } - - auction := types.NewBatchAuction( - ba, - msg.MinBidPrice, - sdk.ZeroDec(), - msg.MaxExtendedRound, - msg.ExtendedRoundRate, - ) - - // Call hook before storing an auction - k.BeforeBatchAuctionCreated( - ctx, - auction.Auctioneer, - auction.StartPrice, - auction.MinBidPrice, - auction.SellingCoin, - auction.PayingCoinDenom, - auction.VestingSchedules, - auction.MaxExtendedRound, - auction.ExtendedRoundRate, - auction.StartTime, - auction.EndTimes[0], - ) - - k.SetAuction(ctx, auction) - - // Call hook after storing an auction - k.AfterBatchAuctionCreated( - ctx, - auction.Id, - auction.Auctioneer, - auction.StartPrice, - auction.MinBidPrice, - auction.SellingCoin, - auction.PayingCoinDenom, - auction.VestingSchedules, - auction.MaxExtendedRound, - auction.ExtendedRoundRate, - auction.StartTime, - auction.EndTimes[0], - ) - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeCreateBatchAuction, - sdk.NewAttribute(types.AttributeKeyAuctionId, strconv.FormatUint(nextId, 10)), - sdk.NewAttribute(types.AttributeKeyAuctioneerAddress, auction.GetAuctioneer().String()), - sdk.NewAttribute(types.AttributeKeySellingReserveAddress, auction.GetSellingReserveAddress().String()), - sdk.NewAttribute(types.AttributeKeyPayingReserveAddress, auction.GetPayingReserveAddress().String()), - sdk.NewAttribute(types.AttributeKeyStartPrice, auction.GetStartPrice().String()), - sdk.NewAttribute(types.AttributeKeySellingCoin, auction.GetSellingCoin().String()), - sdk.NewAttribute(types.AttributeKeyPayingCoinDenom, auction.GetPayingCoinDenom()), - sdk.NewAttribute(types.AttributeKeyVestingReserveAddress, auction.GetVestingReserveAddress().String()), - sdk.NewAttribute(types.AttributeKeyStartTime, auction.GetStartTime().String()), - sdk.NewAttribute(types.AttributeKeyEndTime, msg.EndTime.String()), - sdk.NewAttribute(types.AttributeKeyAuctionStatus, auction.GetStatus().String()), - sdk.NewAttribute(types.AttributeKeyMinBidPrice, auction.MinBidPrice.String()), - sdk.NewAttribute(types.AttributeKeyMaxExtendedRound, fmt.Sprint(auction.MaxExtendedRound)), - sdk.NewAttribute(types.AttributeKeyExtendedRoundRate, auction.ExtendedRoundRate.String()), - ), - }) - - return auction, nil -} - -// CancelAuction handles types.MsgCancelAuction and cancels the auction. -// An auction can only be canceled when it is not started yet. -func (k Keeper) CancelAuction(ctx sdk.Context, msg *types.MsgCancelAuction) error { - auction, found := k.GetAuction(ctx, msg.AuctionId) - if !found { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "auction %d not found", msg.AuctionId) - } - - if auction.GetAuctioneer().String() != msg.Auctioneer { - return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "only the auctioneer can cancel the auction") - } - - if auction.GetStatus() != types.AuctionStatusStandBy { - return sdkerrors.Wrap(types.ErrInvalidAuctionStatus, "only the stand by auction can be cancelled") - } - - sellingReserveAddr := auction.GetSellingReserveAddress() - sellingCoinDenom := auction.GetSellingCoin().Denom - spendableCoins := k.bankKeeper.SpendableCoins(ctx, sellingReserveAddr) - releaseCoin := sdk.NewCoin(sellingCoinDenom, spendableCoins.AmountOf(sellingCoinDenom)) - - // Release the selling coin back to the auctioneer - if err := k.bankKeeper.SendCoins(ctx, sellingReserveAddr, auction.GetAuctioneer(), sdk.NewCoins(releaseCoin)); err != nil { - return sdkerrors.Wrap(err, "failed to release the selling coin") - } - - // Call hook before cancelling the auction - k.BeforeAuctionCanceled(ctx, msg.AuctionId, msg.Auctioneer) - - if auction.GetType() == types.AuctionTypeFixedPrice { - fa := auction.(*types.FixedPriceAuction) - fa.RemainingSellingCoin = sdk.NewCoin(sellingCoinDenom, sdk.ZeroInt()) - auction = fa +// IterateAuctions iterates over all the Auctions and performs a callback function. +func (k Keeper) IterateAuctions(ctx context.Context, cb func(uint64, types.AuctionI) (bool, error)) error { + err := k.Auction.Walk(ctx, nil, cb) + if err != nil { + return err } - - _ = auction.SetStatus(types.AuctionStatusCancelled) - k.SetAuction(ctx, auction) - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeCancelAuction, - sdk.NewAttribute(types.AttributeKeyAuctionId, strconv.FormatUint(auction.GetId(), 10)), - ), - }) - return nil } @@ -279,18 +47,20 @@ func (k Keeper) CancelAuction(ctx sdk.Context, msg *types.MsgCancelAuction) erro // It doesn't have any auctioneer's verification logic because the module is fundamentally designed // to delegate full authorization to an external module. // It is up to an external module to freely add necessary verification and operations depending on their use cases. -func (k Keeper) AddAllowedBidders(ctx sdk.Context, auctionId uint64, allowedBidders []types.AllowedBidder) error { +func (k Keeper) AddAllowedBidders(ctx context.Context, auctionId uint64, allowedBidders []types.AllowedBidder) error { if len(allowedBidders) == 0 { return types.ErrEmptyAllowedBidders } - auction, found := k.GetAuction(ctx, auctionId) - if !found { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "auction %d is not found", auctionId) + auction, err := k.Auction.Get(ctx, auctionId) + if err != nil { + return sdkerrors.Wrapf(err, "auction %d is not found", auctionId) } // Call hook before adding allowed bidders for the auction - k.BeforeAllowedBiddersAdded(ctx, allowedBidders) + if err := k.BeforeAllowedBiddersAdded(ctx, allowedBidders); err != nil { + return err + } // Store new allowed bidders for _, ab := range allowedBidders { @@ -300,7 +70,9 @@ func (k Keeper) AddAllowedBidders(ctx sdk.Context, auctionId uint64, allowedBidd if ab.MaxBidAmount.GT(auction.GetSellingCoin().Amount) { return types.ErrInsufficientRemainingAmount } - k.SetAllowedBidder(ctx, auctionId, ab) + if err := k.AllowedBidder.Set(ctx, collections.Join(auctionId, ab.GetBidder()), ab); err != nil { + return err + } } return nil @@ -311,42 +83,47 @@ func (k Keeper) AddAllowedBidders(ctx sdk.Context, auctionId uint64, allowedBidd // It doesn't have any auctioneer's verification logic because the module is fundamentally designed // to delegate full authorization to an external module. // It is up to an external module to freely add necessary verification and operations depending on their use cases. -func (k Keeper) UpdateAllowedBidder(ctx sdk.Context, auctionId uint64, bidder sdk.AccAddress, maxBidAmount math.Int) error { - _, found := k.GetAuction(ctx, auctionId) - if !found { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "auction %d is not found", auctionId) +func (k Keeper) UpdateAllowedBidder(ctx context.Context, auctionId uint64, bidder sdk.AccAddress, maxBidAmount math.Int) error { + _, err := k.Auction.Get(ctx, auctionId) + if err != nil { + return sdkerrors.Wrapf(err, "auction %d is not found", auctionId) } - _, found = k.GetAllowedBidder(ctx, auctionId, bidder) - if !found { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bidder %s is not found", bidder.String()) + _, err = k.AllowedBidder.Get(ctx, collections.Join(auctionId, bidder)) + if err != nil { + return sdkerrors.Wrapf(errors.ErrNotFound, "bidder %s is not found", bidder.String()) } - allowedBidder := types.NewAllowedBidder(bidder, maxBidAmount) + allowedBidder := types.NewAllowedBidder(auctionId, bidder, maxBidAmount) if err := allowedBidder.Validate(); err != nil { return err } // Call hook before updating the allowed bidders for the auction - k.BeforeAllowedBidderUpdated(ctx, auctionId, bidder, maxBidAmount) + if err := k.BeforeAllowedBidderUpdated(ctx, auctionId, bidder, maxBidAmount); err != nil { + return err + } - k.SetAllowedBidder(ctx, auctionId, allowedBidder) + if err := k.AllowedBidder.Set(ctx, collections.Join(auctionId, bidder), allowedBidder); err != nil { + return sdkerrors.Wrapf(errors.ErrNotFound, "allowed bidder %s no set", bidder.String()) + } return nil } // AllocateSellingCoin allocates allocated selling coin for all matched bids in MatchingInfo and // releases them from the selling reserve account. -func (k Keeper) AllocateSellingCoin(ctx sdk.Context, auction types.AuctionI, mInfo MatchingInfo) error { +func (k Keeper) AllocateSellingCoin(ctx context.Context, auction types.AuctionI, mInfo MatchingInfo) error { // Call hook before selling coin allocation - k.BeforeSellingCoinsAllocated(ctx, auction.GetId(), mInfo.AllocationMap, mInfo.RefundMap) + if err := k.BeforeSellingCoinsAllocated(ctx, auction.GetId(), mInfo.AllocationMap, mInfo.RefundMap); err != nil { + return err + } sellingReserveAddr := auction.GetSellingReserveAddress() sellingCoinDenom := auction.GetSellingCoin().Denom - inputs := []banktypes.Input{} - outputs := []banktypes.Output{} + ioCoins := make(map[string]inOutCoins) // Sort bidders to reserve determinism var bidders []string @@ -364,25 +141,42 @@ func (k Keeper) AllocateSellingCoin(ctx sdk.Context, auction types.AuctionI, mIn allocateCoins := sdk.NewCoins(sdk.NewCoin(sellingCoinDenom, mInfo.AllocationMap[bidder])) bidderAddr, _ := sdk.AccAddressFromBech32(bidder) - inputs = append(inputs, banktypes.NewInput(sellingReserveAddr, allocateCoins)) - outputs = append(outputs, banktypes.NewOutput(bidderAddr, allocateCoins)) + if _, ok := ioCoins[bidderAddr.String()]; !ok { + ioCoins[bidder] = inOutCoins{ + bidder: bidder, + outputs: []banktypes.Output{banktypes.NewOutput(bidderAddr, allocateCoins)}, + input: banktypes.NewInput(sellingReserveAddr, allocateCoins), + } + continue + } + + inout := ioCoins[bidder] + inout.input.Coins = inout.input.Coins.Add(allocateCoins...) + inout.outputs = append(inout.outputs, banktypes.NewOutput(bidderAddr, allocateCoins)) + ioCoins[bidder] = inout } - // Send all at once - if err := k.bankKeeper.InputOutputCoins(ctx, inputs, outputs); err != nil { - return err + // Send all inputs + for _, inout := range ioCoins { + if err := k.bankKeeper.InputOutputCoins(ctx, inout.input, inout.outputs); err != nil { + return err + } } return nil } // ReleaseVestingPayingCoin releases the vested selling coin to the auctioneer from the vesting reserve account. -func (k Keeper) ReleaseVestingPayingCoin(ctx sdk.Context, auction types.AuctionI) error { - vestingQueues := k.GetVestingQueuesByAuctionId(ctx, auction.GetId()) +func (k Keeper) ReleaseVestingPayingCoin(ctx context.Context, auction types.AuctionI) error { + vestingQueues, err := k.GetVestingQueuesByAuctionId(ctx, auction.GetId()) + if err != nil { + return err + } vestingQueuesLen := len(vestingQueues) for i, vestingQueue := range vestingQueues { - if vestingQueue.ShouldRelease(ctx.BlockTime()) { + blockTime := sdk.UnwrapSDKContext(ctx).BlockTime() + if vestingQueue.ShouldRelease(blockTime) { vestingReserveAddr := auction.GetVestingReserveAddress() auctioneerAddr := auction.GetAuctioneer() payingCoins := sdk.NewCoins(vestingQueue.PayingCoin) @@ -392,12 +186,21 @@ func (k Keeper) ReleaseVestingPayingCoin(ctx sdk.Context, auction types.AuctionI } vestingQueue.SetReleased(true) - k.SetVestingQueue(ctx, vestingQueue) + if err := k.VestingQueue.Set(ctx, collections.Join( + vestingQueue.AuctionId, + vestingQueue.ReleaseTime, + ), vestingQueue); err != nil { + return err + } // Update status when all the amounts are released if i == vestingQueuesLen-1 { - _ = auction.SetStatus(types.AuctionStatusFinished) - k.SetAuction(ctx, auction) + if err := auction.SetStatus(types.AuctionStatusFinished); err != nil { + return err + } + if err := k.Auction.Set(ctx, auction.GetId(), auction); err != nil { + return err + } } } } @@ -406,7 +209,7 @@ func (k Keeper) ReleaseVestingPayingCoin(ctx sdk.Context, auction types.AuctionI } // RefundRemainingSellingCoin refunds the remaining selling coin to the auctioneer. -func (k Keeper) RefundRemainingSellingCoin(ctx sdk.Context, auction types.AuctionI) error { +func (k Keeper) RefundRemainingSellingCoin(ctx context.Context, auction types.AuctionI) error { sellingReserveAddr := auction.GetSellingReserveAddress() sellingCoinDenom := auction.GetSellingCoin().Denom spendableCoins := k.bankKeeper.SpendableCoins(ctx, sellingReserveAddr) @@ -419,12 +222,11 @@ func (k Keeper) RefundRemainingSellingCoin(ctx sdk.Context, auction types.Auctio } // RefundPayingCoin refunds paying coin to the corresponding bidders. -func (k Keeper) RefundPayingCoin(ctx sdk.Context, auction types.AuctionI, mInfo MatchingInfo) error { +func (k Keeper) RefundPayingCoin(ctx context.Context, auction types.AuctionI, mInfo MatchingInfo) error { payingReserveAddr := auction.GetPayingReserveAddress() payingCoinDenom := auction.GetPayingCoinDenom() - inputs := []banktypes.Input{} - outputs := []banktypes.Output{} + ioCoins := make(map[string]inOutCoins) // Sort bidders to reserve determinism var bidders []string @@ -445,109 +247,378 @@ func (k Keeper) RefundPayingCoin(ctx sdk.Context, auction types.AuctionI, mInfo } refundCoins := sdk.NewCoins(sdk.NewCoin(payingCoinDenom, mInfo.RefundMap[bidder])) - inputs = append(inputs, banktypes.NewInput(payingReserveAddr, refundCoins)) - outputs = append(outputs, banktypes.NewOutput(bidderAddr, refundCoins)) + if _, ok := ioCoins[bidderAddr.String()]; !ok { + ioCoins[bidder] = inOutCoins{ + bidder: bidder, + outputs: []banktypes.Output{banktypes.NewOutput(bidderAddr, refundCoins)}, + input: banktypes.NewInput(payingReserveAddr, refundCoins), + } + continue + } + + inout := ioCoins[bidder] + inout.input.Coins = inout.input.Coins.Add(refundCoins...) + inout.outputs = append(inout.outputs, banktypes.NewOutput(bidderAddr, refundCoins)) + ioCoins[bidder] = inout } - // Send all at once - if err := k.bankKeeper.InputOutputCoins(ctx, inputs, outputs); err != nil { - return err + // Send all inputs. + for _, inout := range ioCoins { + if err := k.bankKeeper.InputOutputCoins(ctx, inout.input, inout.outputs); err != nil { + return err + } } return nil } // ExtendRound extends another round of ExtendedPeriod value for the auction. -func (k Keeper) ExtendRound(ctx sdk.Context, ba *types.BatchAuction) { - params := k.GetParams(ctx) +func (k Keeper) ExtendRound(ctx context.Context, ba *types.BatchAuction) error { + params, err := k.Params.Get(ctx) + if err != nil { + return err + } extendedPeriod := params.ExtendedPeriod nextEndTime := ba.GetEndTimes()[len(ba.GetEndTimes())-1].AddDate(0, 0, int(extendedPeriod)) endTimes := append(ba.GetEndTimes(), nextEndTime) _ = ba.SetEndTimes(endTimes) - k.SetAuction(ctx, ba) + + return k.Auction.Set(ctx, ba.GetId(), ba) } // CloseFixedPriceAuction closes a fixed price auction. -func (k Keeper) CloseFixedPriceAuction(ctx sdk.Context, auction types.AuctionI) { - mInfo := k.CalculateFixedPriceAllocation(ctx, auction) +func (k Keeper) CloseFixedPriceAuction(ctx context.Context, auction types.AuctionI) error { + mInfo, err := k.CalculateFixedPriceAllocation(ctx, auction) + if err != nil { + return err + } if err := k.AllocateSellingCoin(ctx, auction, mInfo); err != nil { - panic(err) + return err } if err := k.RefundRemainingSellingCoin(ctx, auction); err != nil { - panic(err) + return err } if err := k.ApplyVestingSchedules(ctx, auction); err != nil { - panic(err) + return err } + + return nil } // CloseBatchAuction closes a batch auction. -func (k Keeper) CloseBatchAuction(ctx sdk.Context, auction types.AuctionI) { +func (k Keeper) CloseBatchAuction(ctx context.Context, auction types.AuctionI) error { ba, ok := auction.(*types.BatchAuction) if !ok { - panic(fmt.Errorf("unable to close auction that is not a batch auction: %T", auction)) + return fmt.Errorf("unable to close auction that is not a batch auction: %T", auction) } // Extend round since there is no last matched length to compare with - lastMatchedLen := k.GetLastMatchedBidsLen(ctx, ba.GetId()) - mInfo := k.CalculateBatchAllocation(ctx, auction) + lastMatchedLen, err := k.GetLastMatchedBidsLen(ctx, ba.GetId()) + if err != nil { + return err + } + mInfo, err := k.CalculateBatchAllocation(ctx, auction) + if err != nil { + return err + } // Close the auction when maximum extended round + 1 is the same as the length of end times // If the value of MaxExtendedRound is 0, it means that an auctioneer does not want have an extended round if ba.MaxExtendedRound+1 == uint32(len(auction.GetEndTimes())) { if err := k.AllocateSellingCoin(ctx, auction, mInfo); err != nil { - panic(err) + return err } if err := k.RefundRemainingSellingCoin(ctx, auction); err != nil { - panic(err) + return err } if err := k.RefundPayingCoin(ctx, auction, mInfo); err != nil { - panic(err) + return err } if err := k.ApplyVestingSchedules(ctx, auction); err != nil { - panic(err) + return err } - return + return nil } if lastMatchedLen == 0 { - k.ExtendRound(ctx, ba) - return + return k.ExtendRound(ctx, ba) } - currDec := sdk.NewDec(mInfo.MatchedLen) - lastDec := sdk.NewDec(lastMatchedLen) - diff := sdk.OneDec().Sub(currDec.Quo(lastDec)) // 1 - (CurrentMatchedLenDec / LastMatchedLenDec) + currDec := math.LegacyNewDec(mInfo.MatchedLen) + lastDec := math.LegacyNewDec(lastMatchedLen) + diff := math.LegacyOneDec().Sub(currDec.Quo(lastDec)) // 1 - (CurrentMatchedLenDec / LastMatchedLenDec) // To prevent from auction sniping technique, compare the extended round rate with // the current and the last length of matched bids to determine // if the auction needs another extended round if diff.GTE(ba.ExtendedRoundRate) { - k.ExtendRound(ctx, ba) - return + return k.ExtendRound(ctx, ba) } if err := k.AllocateSellingCoin(ctx, auction, mInfo); err != nil { - panic(err) + return err } if err := k.RefundRemainingSellingCoin(ctx, auction); err != nil { - panic(err) + return err } if err := k.RefundPayingCoin(ctx, auction, mInfo); err != nil { - panic(err) + return err } if err := k.ApplyVestingSchedules(ctx, auction); err != nil { - panic(err) + return err + } + + return nil +} + +// CreateFixedPriceAuction handles types.MsgCreateFixedPriceAuction and create a fixed price auction. +// Note that the module is designed to delegate authorization to an external module to add allowed bidders for the auction. +func (k Keeper) CreateFixedPriceAuction(ctx context.Context, msg *types.MsgCreateFixedPriceAuction) (types.AuctionI, error) { + blockTime := sdk.UnwrapSDKContext(ctx).BlockTime() + if blockTime.After(msg.EndTime) { // EndTime < CurrentTime + return nil, sdkerrors.Wrap(errors.ErrInvalidRequest, "end time must be set after the current time") + } + + if len(msg.VestingSchedules) > types.MaxNumVestingSchedules { + return nil, sdkerrors.Wrap(errors.ErrInvalidRequest, "exceed maximum number of vesting schedules") + } + + nextId, err := k.AuctionSeq.Next(ctx) + if err != nil { + return nil, err + } + + auctioneer, err := sdk.AccAddressFromBech32(msg.GetAuctioneer()) + if err != nil { + return nil, err + } + + if err := k.PayCreationFee(ctx, auctioneer); err != nil { + return nil, sdkerrors.Wrap(err, "failed to pay auction creation fee") + } + + if err := k.ReserveSellingCoin(ctx, nextId, auctioneer, msg.SellingCoin); err != nil { + return nil, sdkerrors.Wrap(err, "failed to reserve selling coin") + } + + ba := types.NewBaseAuction( + nextId, + types.AuctionTypeFixedPrice, + msg.Auctioneer, + types.SellingReserveAddress(nextId).String(), + types.PayingReserveAddress(nextId).String(), + msg.StartPrice, + msg.SellingCoin, + msg.PayingCoinDenom, + types.VestingReserveAddress(nextId).String(), + msg.VestingSchedules, + msg.StartTime, + []time.Time{msg.EndTime}, // it is an array data type to handle BatchAuction + types.AuctionStatusStandBy, + ) + + // Update status if the start time is already passed over the current time + if ba.ShouldAuctionStarted(blockTime) { + _ = ba.SetStatus(types.AuctionStatusStarted) + } + + auction := types.NewFixedPriceAuction(ba, msg.SellingCoin) + + // Call hook before storing an auction + if err := k.BeforeFixedPriceAuctionCreated( + ctx, + auction.Auctioneer, + auction.StartPrice, + auction.SellingCoin, + auction.PayingCoinDenom, + auction.VestingSchedules, + auction.StartTime, + auction.EndTimes[0], + ); err != nil { + return nil, err + } + + if err := k.Auction.Set(ctx, ba.GetId(), auction); err != nil { + return nil, err + } + + // Call hook after storing an auction + if err := k.AfterFixedPriceAuctionCreated( + ctx, + auction.Id, + auction.Auctioneer, + auction.StartPrice, + auction.SellingCoin, + auction.PayingCoinDenom, + auction.VestingSchedules, + auction.StartTime, + auction.EndTimes[0], + ); err != nil { + return nil, err + } + + return auction, nil +} + +// CreateBatchAuction handles types.MsgCreateBatchAuction and create a batch auction. +// Note that the module is designed to delegate authorization to an external module to add allowed bidders for the auction. +func (k Keeper) CreateBatchAuction(ctx context.Context, msg *types.MsgCreateBatchAuction) (types.AuctionI, error) { + blockTime := sdk.UnwrapSDKContext(ctx).BlockTime() + if blockTime.After(msg.EndTime) { // EndTime < CurrentTime + return nil, sdkerrors.Wrap(errors.ErrInvalidRequest, "end time must be set after the current time") + } + + if len(msg.VestingSchedules) > types.MaxNumVestingSchedules { + return nil, sdkerrors.Wrap(errors.ErrInvalidRequest, "exceed maximum number of vesting schedules") + } + + if msg.MaxExtendedRound > types.MaxExtendedRound { + return nil, sdkerrors.Wrap(errors.ErrInvalidRequest, "exceed maximum extended round") + } + + nextId, err := k.AuctionSeq.Next(ctx) + if err != nil { + return nil, err + } + + auctioneer, err := sdk.AccAddressFromBech32(msg.GetAuctioneer()) + if err != nil { + return nil, err + } + + if err := k.PayCreationFee(ctx, auctioneer); err != nil { + return nil, sdkerrors.Wrap(err, "failed to pay auction creation fee") } + + if err := k.ReserveSellingCoin(ctx, nextId, auctioneer, msg.SellingCoin); err != nil { + return nil, sdkerrors.Wrap(err, "failed to reserve selling coin") + } + + endTimes := []time.Time{msg.EndTime} // it is an array data type to handle BatchAuction + + ba := types.NewBaseAuction( + nextId, + types.AuctionTypeBatch, + msg.Auctioneer, + types.SellingReserveAddress(nextId).String(), + types.PayingReserveAddress(nextId).String(), + msg.StartPrice, + msg.SellingCoin, + msg.PayingCoinDenom, + types.VestingReserveAddress(nextId).String(), + msg.VestingSchedules, + msg.StartTime, + endTimes, + types.AuctionStatusStandBy, + ) + + // Update status if the start time is already passed the current time + if ba.ShouldAuctionStarted(blockTime) { + _ = ba.SetStatus(types.AuctionStatusStarted) + } + + auction := types.NewBatchAuction( + ba, + msg.MinBidPrice, + math.LegacyZeroDec(), + msg.MaxExtendedRound, + msg.ExtendedRoundRate, + ) + + // Call hook before storing an auction + if err := k.BeforeBatchAuctionCreated( + ctx, + auction.Auctioneer, + auction.StartPrice, + auction.MinBidPrice, + auction.SellingCoin, + auction.PayingCoinDenom, + auction.VestingSchedules, + auction.MaxExtendedRound, + auction.ExtendedRoundRate, + auction.StartTime, + auction.EndTimes[0], + ); err != nil { + return nil, err + } + + if err := k.Auction.Set(ctx, ba.GetId(), auction); err != nil { + return nil, err + } + + // Call hook after storing an auction + if err := k.AfterBatchAuctionCreated( + ctx, + auction.Id, + auction.Auctioneer, + auction.StartPrice, + auction.MinBidPrice, + auction.SellingCoin, + auction.PayingCoinDenom, + auction.VestingSchedules, + auction.MaxExtendedRound, + auction.ExtendedRoundRate, + auction.StartTime, + auction.EndTimes[0], + ); err != nil { + return nil, err + } + + return auction, nil +} + +// CancelAuction handles types.MsgCancelAuction and cancels the auction. +// An auction can only be canceled when it is not started yet. +func (k Keeper) CancelAuction(ctx context.Context, msg *types.MsgCancelAuction) error { + auction, err := k.Auction.Get(ctx, msg.AuctionId) + if err != nil { + return err + } + + if auction.GetAuctioneer().String() != msg.Auctioneer { + return sdkerrors.Wrap(errors.ErrUnauthorized, "only the auctioneer can cancel the auction") + } + + if auction.GetStatus() != types.AuctionStatusStandBy { + return sdkerrors.Wrap(types.ErrInvalidAuctionStatus, "only the stand by auction can be cancelled") + } + + sellingReserveAddr := auction.GetSellingReserveAddress() + sellingCoinDenom := auction.GetSellingCoin().Denom + spendableCoins := k.bankKeeper.SpendableCoins(ctx, sellingReserveAddr) + releaseCoin := sdk.NewCoin(sellingCoinDenom, spendableCoins.AmountOf(sellingCoinDenom)) + + // Release the selling coin back to the auctioneer + if err := k.bankKeeper.SendCoins(ctx, sellingReserveAddr, auction.GetAuctioneer(), sdk.NewCoins(releaseCoin)); err != nil { + return sdkerrors.Wrap(err, "failed to release the selling coin") + } + + // Call hook before cancelling the auction + if err := k.BeforeAuctionCanceled(ctx, msg.AuctionId, msg.Auctioneer); err != nil { + return err + } + + if auction.GetType() == types.AuctionTypeFixedPrice { + fa := auction.(*types.FixedPriceAuction) + fa.RemainingSellingCoin = sdk.NewCoin(sellingCoinDenom, math.ZeroInt()) + auction = fa + } + + _ = auction.SetStatus(types.AuctionStatusCancelled) + if err := k.Auction.Set(ctx, auction.GetId(), auction); err != nil { + return err + } + + return nil } diff --git a/x/fundraising/keeper/auction_test.go b/x/fundraising/keeper/auction_test.go index 11c7c4cc..5a4d224b 100644 --- a/x/fundraising/keeper/auction_test.go +++ b/x/fundraising/keeper/auction_test.go @@ -3,12 +3,13 @@ package keeper_test import ( "time" + "cosmossdk.io/collections" + sdkerrors "cosmossdk.io/errors" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/errors" _ "github.com/stretchr/testify/suite" - "github.com/tendermint/fundraising/x/fundraising" "github.com/tendermint/fundraising/x/fundraising/types" ) @@ -24,13 +25,18 @@ func (s *KeeperTestSuite) TestFixedPriceAuction_AuctionStatus() { true, ) - auction, found := s.keeper.GetAuction(s.ctx, standByAuction.GetId()) - s.Require().True(found) + auction, err := s.keeper.Auction.Get(s.ctx, standByAuction.GetId()) + s.Require().NoError(err) s.Require().Equal(types.AuctionStatusStandBy, auction.GetStatus()) - feePool := s.app.DistrKeeper.GetFeePool(s.ctx) - auctionCreationFee := s.keeper.GetParams(s.ctx).AuctionCreationFee - s.Require().True(feePool.CommunityPool.IsEqual(sdk.NewDecCoinsFromCoins(auctionCreationFee...))) + feePool, err := s.app.DistrKeeper.FeePool.Get(s.ctx) + s.Require().NoError(err) + + params, err := s.keeper.Params.Get(s.ctx) + s.Require().NoError(err) + + auctionCreationFee := params.AuctionCreationFee + s.Require().True(feePool.CommunityPool.Equal(sdk.NewDecCoinsFromCoins(auctionCreationFee...))) startedAuction := s.createFixedPriceAuction( s.addr(1), @@ -43,8 +49,8 @@ func (s *KeeperTestSuite) TestFixedPriceAuction_AuctionStatus() { true, ) - auction, found = s.keeper.GetAuction(s.ctx, startedAuction.GetId()) - s.Require().True(found) + auction, err = s.keeper.Auction.Get(s.ctx, startedAuction.GetId()) + s.Require().NoError(err) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) } @@ -60,15 +66,17 @@ func (s *KeeperTestSuite) TestFixedPriceAuction_BidWithPayingCoinDenom() { true, ) - auction, found := s.keeper.GetAuction(s.ctx, startedAuction.GetId()) - s.Require().True(found) + auction, err := s.keeper.Auction.Get(s.ctx, startedAuction.GetId()) + s.Require().NoError(err) s.placeBidFixedPrice(auction.GetId(), s.addr(1), auction.GetStartPrice(), parseCoin("1_000_000denom2"), true) s.placeBidFixedPrice(auction.GetId(), s.addr(1), auction.GetStartPrice(), parseCoin("1_000_000denom2"), true) s.placeBidFixedPrice(auction.GetId(), s.addr(1), auction.GetStartPrice(), parseCoin("1_000_000denom2"), true) // Make sure allocate amount is equal to the total bid amount made by the same bidder - mInfo := s.keeper.CalculateFixedPriceAllocation(s.ctx, auction) + mInfo, err := s.keeper.CalculateFixedPriceAllocation(s.ctx, auction) + s.Require().NoError(err) + allocateAmt := mInfo.AllocationMap[s.addr(1).String()] s.Require().Equal(allocateAmt, parseCoin("6_000_000denom1").Amount) } @@ -85,15 +93,17 @@ func (s *KeeperTestSuite) TestFixedPriceAuction_BidWithSellingCoinDenom() { true, ) - auction, found := s.keeper.GetAuction(s.ctx, startedAuction.GetId()) - s.Require().True(found) + auction, err := s.keeper.Auction.Get(s.ctx, startedAuction.GetId()) + s.Require().NoError(err) s.placeBidFixedPrice(auction.GetId(), s.addr(1), auction.GetStartPrice(), parseCoin("1_000_000denom1"), true) s.placeBidFixedPrice(auction.GetId(), s.addr(1), auction.GetStartPrice(), parseCoin("1_000_000denom1"), true) s.placeBidFixedPrice(auction.GetId(), s.addr(1), auction.GetStartPrice(), parseCoin("1_000_000denom1"), true) // Make sure allocate amount is equal to the total bid amount made by the same bidder - mInfo := s.keeper.CalculateFixedPriceAllocation(s.ctx, auction) + mInfo, err := s.keeper.CalculateFixedPriceAllocation(s.ctx, auction) + s.Require().NoError(err) + allocateAmt := mInfo.AllocationMap[s.addr(1).String()] s.Require().Equal(allocateAmt, parseCoin("3_000_000denom1").Amount) } @@ -110,8 +120,8 @@ func (s *KeeperTestSuite) TestFixedPriceAuction_BidWithBoth() { true, ) - auction, found := s.keeper.GetAuction(s.ctx, startedAuction.GetId()) - s.Require().True(found) + auction, err := s.keeper.Auction.Get(s.ctx, startedAuction.GetId()) + s.Require().NoError(err) s.placeBidFixedPrice(auction.GetId(), s.addr(1), auction.GetStartPrice(), parseCoin("2_000_000denom1"), true) s.placeBidFixedPrice(auction.GetId(), s.addr(1), auction.GetStartPrice(), parseCoin("2_000_000denom1"), true) @@ -120,7 +130,9 @@ func (s *KeeperTestSuite) TestFixedPriceAuction_BidWithBoth() { s.placeBidFixedPrice(auction.GetId(), s.addr(2), auction.GetStartPrice(), parseCoin("1_000_000denom2"), true) // Make sure allocate amount is equal to the total bid amount made by the same bidder - mInfo := s.keeper.CalculateFixedPriceAllocation(s.ctx, auction) + mInfo, err := s.keeper.CalculateFixedPriceAllocation(s.ctx, auction) + s.Require().NoError(err) + s.Require().Equal(mInfo.AllocationMap[s.addr(1).String()], parseCoin("8_000_000denom2").Amount) s.Require().Equal(mInfo.AllocationMap[s.addr(2).String()], parseCoin("3_000_000denom2").Amount) } @@ -137,8 +149,8 @@ func (s *KeeperTestSuite) TestFixedPriceAuction_AllocateSellingCoin() { true, ) - _, found := s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) + _, err := s.keeper.Auction.Get(s.ctx, auction.GetId()) + s.Require().NoError(err) // Place bids s.placeBidFixedPrice(auction.Id, s.addr(1), parseDec("0.5"), parseCoin("100_000_000denom2"), true) @@ -146,10 +158,11 @@ func (s *KeeperTestSuite) TestFixedPriceAuction_AllocateSellingCoin() { s.placeBidFixedPrice(auction.Id, s.addr(3), parseDec("0.5"), parseCoin("200_000_000denom1"), true) // Calculate allocation - mInfo := s.keeper.CalculateFixedPriceAllocation(s.ctx, auction) + mInfo, err := s.keeper.CalculateFixedPriceAllocation(s.ctx, auction) + s.Require().NoError(err) // Distribute selling coin - err := s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) + err = s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) s.Require().NoError(err) err = s.keeper.RefundRemainingSellingCoin(s.ctx, auction) @@ -177,19 +190,19 @@ func (s *KeeperTestSuite) TestFixedPriceAuction_ReleaseVestingPayingCoin() { []types.VestingSchedule{ { ReleaseTime: time.Now().AddDate(0, 6, 0), - Weight: sdk.MustNewDecFromStr("0.25"), + Weight: math.LegacyMustNewDecFromStr("0.25"), }, { ReleaseTime: time.Now().AddDate(0, 9, 0), - Weight: sdk.MustNewDecFromStr("0.25"), + Weight: math.LegacyMustNewDecFromStr("0.25"), }, { ReleaseTime: time.Now().AddDate(1, 0, 0), - Weight: sdk.MustNewDecFromStr("0.25"), + Weight: math.LegacyMustNewDecFromStr("0.25"), }, { ReleaseTime: time.Now().AddDate(1, 3, 0), - Weight: sdk.MustNewDecFromStr("0.25"), + Weight: math.LegacyMustNewDecFromStr("0.25"), }, }, time.Now().AddDate(0, 0, -1), @@ -204,10 +217,11 @@ func (s *KeeperTestSuite) TestFixedPriceAuction_ReleaseVestingPayingCoin() { s.placeBidFixedPrice(auction.GetId(), s.addr(1), parseDec("1"), parseCoin("200_000_000denom2"), true) // Calculate allocation - mInfo := s.keeper.CalculateFixedPriceAllocation(s.ctx, auction) + mInfo, err := s.keeper.CalculateFixedPriceAllocation(s.ctx, auction) + s.Require().NoError(err) // Distribute selling coin - err := s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) + err = s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) s.Require().NoError(err) // Apply vesting schedules @@ -215,7 +229,9 @@ func (s *KeeperTestSuite) TestFixedPriceAuction_ReleaseVestingPayingCoin() { s.Require().NoError(err) // All of the vesting queues must not be released yet - vqs := s.keeper.GetVestingQueuesByAuctionId(s.ctx, auction.GetId()) + vqs, err := s.keeper.GetVestingQueuesByAuctionId(s.ctx, auction.GetId()) + s.Require().NoError(err) + s.Require().Equal(4, len(vqs)) for _, vq := range vqs { s.Require().False(vq.Released) @@ -223,14 +239,18 @@ func (s *KeeperTestSuite) TestFixedPriceAuction_ReleaseVestingPayingCoin() { // Change the block time to release two vesting schedules s.ctx = s.ctx.WithBlockTime(vqs[0].GetReleaseTime().AddDate(0, 4, 1)) - fundraising.BeginBlocker(s.ctx, s.keeper) + err = s.keeper.BeginBlocker(s.ctx) + s.Require().NoError(err) // Distribute paying coin err = s.keeper.ReleaseVestingPayingCoin(s.ctx, auction) s.Require().NoError(err) // First two vesting queues must be released - for i, vq := range s.keeper.GetVestingQueuesByAuctionId(s.ctx, auction.GetId()) { + vqsa, err := s.keeper.GetVestingQueuesByAuctionId(s.ctx, auction.GetId()) + s.Require().NoError(err) + + for i, vq := range vqsa { if i == 0 || i == 1 { s.Require().True(vq.Released) } else { @@ -240,16 +260,19 @@ func (s *KeeperTestSuite) TestFixedPriceAuction_ReleaseVestingPayingCoin() { // Change the block time s.ctx = s.ctx.WithBlockTime(vqs[3].GetReleaseTime().AddDate(0, 0, 1)) - fundraising.BeginBlocker(s.ctx, s.keeper) + err = s.keeper.BeginBlocker(s.ctx) + s.Require().NoError(err) s.Require().NoError(s.keeper.ReleaseVestingPayingCoin(s.ctx, auction)) // All of the vesting queues must be released - for _, vq := range s.keeper.GetVestingQueuesByAuctionId(s.ctx, auction.GetId()) { + vqByAuction, err := s.keeper.GetVestingQueuesByAuctionId(s.ctx, auction.GetId()) + s.Require().NoError(err) + for _, vq := range vqByAuction { s.Require().True(vq.Released) } - finishedAuction, found := s.keeper.GetAuction(s.ctx, auction.GetId()) - s.Require().True(found) + finishedAuction, err := s.keeper.Auction.Get(s.ctx, auction.GetId()) + s.Require().NoError(err) s.Require().Equal(types.AuctionStatusFinished, finishedAuction.GetStatus()) } @@ -271,14 +294,14 @@ func (s *KeeperTestSuite) TestFixedPriceAuction_CancelAuction() { Auctioneer: auction.Auctioneer, AuctionId: 10, }) - s.Require().Error(err, sdkerrors.ErrNotFound) + s.Require().Error(err, errors.ErrNotFound) // Unauthorized err = s.keeper.CancelAuction(s.ctx, &types.MsgCancelAuction{ Auctioneer: s.addr(10).String(), AuctionId: auction.Id, }) - s.Require().Error(err, sdkerrors.ErrUnauthorized) + s.Require().Error(err, errors.ErrUnauthorized) // Invalid auction status err = s.keeper.CancelAuction(s.ctx, &types.MsgCancelAuction{ @@ -290,7 +313,8 @@ func (s *KeeperTestSuite) TestFixedPriceAuction_CancelAuction() { // Forcefully update auction status err = auction.SetStatus(types.AuctionStatusStandBy) s.Require().NoError(err) - s.keeper.SetAuction(s.ctx, auction) + err = s.keeper.Auction.Set(s.ctx, auction.GetId(), auction) + s.Require().NoError(err) // Cancel the auction err = s.keeper.CancelAuction(s.ctx, &types.MsgCancelAuction{ @@ -300,8 +324,8 @@ func (s *KeeperTestSuite) TestFixedPriceAuction_CancelAuction() { s.Require().NoError(err) // Verify the status - a, found := s.keeper.GetAuction(s.ctx, auction.GetId()) - s.Require().True(found) + a, err := s.keeper.Auction.Get(s.ctx, auction.GetId()) + s.Require().NoError(err) s.Require().Equal(types.AuctionStatusCancelled, a.GetStatus()) // The selling reserve balance must be zero @@ -319,19 +343,23 @@ func (s *KeeperTestSuite) TestBatchAuction_AuctionStatus() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 6, 0), time.Now().AddDate(0, 6, 0).AddDate(0, 1, 0), true, ) - auction, found := s.keeper.GetAuction(s.ctx, standByAuction.GetId()) - s.Require().True(found) + auction, err := s.keeper.Auction.Get(s.ctx, standByAuction.GetId()) + s.Require().NoError(err) s.Require().Equal(types.AuctionStatusStandBy, auction.GetStatus()) - feePool := s.app.DistrKeeper.GetFeePool(s.ctx) - auctionCreationFee := s.keeper.GetParams(s.ctx).AuctionCreationFee - s.Require().True(feePool.CommunityPool.IsEqual(sdk.NewDecCoinsFromCoins(auctionCreationFee...))) + feePool, err := s.app.DistrKeeper.FeePool.Get(s.ctx) + s.Require().NoError(err) + + params, err := s.keeper.Params.Get(s.ctx) + s.Require().NoError(err) + auctionCreationFee := params.AuctionCreationFee + s.Require().True(feePool.CommunityPool.Equal(sdk.NewDecCoinsFromCoins(auctionCreationFee...))) startedAuction := s.createBatchAuction( s.addr(1), @@ -341,14 +369,14 @@ func (s *KeeperTestSuite) TestBatchAuction_AuctionStatus() { "denom4", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, ) - auction, found = s.keeper.GetAuction(s.ctx, startedAuction.GetId()) - s.Require().True(found) + auction, err = s.keeper.Auction.Get(s.ctx, startedAuction.GetId()) + s.Require().NoError(err) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) } @@ -361,32 +389,34 @@ func (s *KeeperTestSuite) TestBatchAuction_MaxNumVestingSchedules() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 6, 0), time.Now().AddDate(0, 6, 0).AddDate(0, 1, 0), ) - params := s.keeper.GetParams(s.ctx) + params, err := s.keeper.Params.Get(s.ctx) + s.Require().NoError(err) + s.fundAddr(s.addr(0), params.AuctionCreationFee.Add(batchAuction.SellingCoin)) // Invalid max extended round batchAuction.MaxExtendedRound = types.MaxExtendedRound + 1 - _, err := s.keeper.CreateBatchAuction(s.ctx, batchAuction) - s.Require().EqualError(err, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "exceed maximum extended round").Error()) + _, err = s.keeper.CreateBatchAuction(s.ctx, batchAuction) + s.Require().EqualError(err, sdkerrors.Wrap(errors.ErrInvalidRequest, "exceed maximum extended round").Error()) batchAuction.MaxExtendedRound = 1 // Invalid number of vesting schedules numSchedules := types.MaxNumVestingSchedules + 1 schedules := make([]types.VestingSchedule, numSchedules) - totalWeight := sdk.ZeroDec() + totalWeight := math.LegacyZeroDec() for i := range schedules { var schedule types.VestingSchedule if i == numSchedules-1 { - schedule.Weight = sdk.OneDec().Sub(totalWeight) + schedule.Weight = math.LegacyOneDec().Sub(totalWeight) } else { - schedule.Weight = sdk.OneDec().Quo(sdk.NewDec(int64(numSchedules))) + schedule.Weight = math.LegacyOneDec().Quo(math.LegacyNewDec(int64(numSchedules))) } schedule.ReleaseTime = time.Now().AddDate(0, 0, i) @@ -396,7 +426,7 @@ func (s *KeeperTestSuite) TestBatchAuction_MaxNumVestingSchedules() { batchAuction.VestingSchedules = schedules _, err = s.keeper.CreateBatchAuction(s.ctx, batchAuction) - s.Require().EqualError(err, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "exceed maximum number of vesting schedules").Error()) + s.Require().EqualError(err, sdkerrors.Wrap(errors.ErrInvalidRequest, "exceed maximum number of vesting schedules").Error()) } func (s *KeeperTestSuite) TestFixedPriceAuction_MaxNumVestingSchedules() { @@ -410,19 +440,20 @@ func (s *KeeperTestSuite) TestFixedPriceAuction_MaxNumVestingSchedules() { time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), ) - params := s.keeper.GetParams(s.ctx) + params, err := s.keeper.Params.Get(s.ctx) + s.Require().NoError(err) s.fundAddr(s.addr(0), params.AuctionCreationFee.Add(fixedPriceAuction.SellingCoin)) // Invalid number of vesting schedules numSchedules := types.MaxNumVestingSchedules + 1 schedules := make([]types.VestingSchedule, numSchedules) - totalWeight := sdk.ZeroDec() + totalWeight := math.LegacyZeroDec() for i := range schedules { var schedule types.VestingSchedule if i == numSchedules-1 { - schedule.Weight = sdk.OneDec().Sub(totalWeight) + schedule.Weight = math.LegacyOneDec().Sub(totalWeight) } else { - schedule.Weight = sdk.OneDec().Quo(sdk.NewDec(int64(numSchedules))) + schedule.Weight = math.LegacyOneDec().Quo(math.LegacyNewDec(int64(numSchedules))) } schedule.ReleaseTime = time.Now().AddDate(0, 0, i) @@ -431,12 +462,13 @@ func (s *KeeperTestSuite) TestFixedPriceAuction_MaxNumVestingSchedules() { } fixedPriceAuction.VestingSchedules = schedules - _, err := s.keeper.CreateFixedPriceAuction(s.ctx, fixedPriceAuction) - s.Require().EqualError(err, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "exceed maximum number of vesting schedules").Error()) + _, err = s.keeper.CreateFixedPriceAuction(s.ctx, fixedPriceAuction) + s.Require().EqualError(err, sdkerrors.Wrap(errors.ErrInvalidRequest, "exceed maximum number of vesting schedules").Error()) } func (s *KeeperTestSuite) TestInvalidEndTime() { - params := s.keeper.GetParams(s.ctx) + params, err := s.keeper.Params.Get(s.ctx) + s.Require().NoError(err) fixedPriceAuction := types.NewMsgCreateFixedPriceAuction( s.addr(0).String(), @@ -449,8 +481,8 @@ func (s *KeeperTestSuite) TestInvalidEndTime() { ) s.fundAddr(s.addr(0), params.AuctionCreationFee.Add(fixedPriceAuction.SellingCoin)) - _, err := s.keeper.CreateFixedPriceAuction(s.ctx, fixedPriceAuction) - s.Require().EqualError(err, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "end time must be set after the current time").Error()) + _, err = s.keeper.CreateFixedPriceAuction(s.ctx, fixedPriceAuction) + s.Require().EqualError(err, sdkerrors.Wrap(errors.ErrInvalidRequest, "end time must be set after the current time").Error()) batchAuction := types.NewMsgCreateBatchAuction( s.addr(1).String(), @@ -460,14 +492,14 @@ func (s *KeeperTestSuite) TestInvalidEndTime() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), types.MustParseRFC3339("2022-03-01T00:00:00Z"), types.MustParseRFC3339("2022-01-01T00:00:00Z"), ) s.fundAddr(s.addr(1), params.AuctionCreationFee.Add(batchAuction.SellingCoin)) _, err = s.keeper.CreateBatchAuction(s.ctx, batchAuction) - s.Require().EqualError(err, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "end time must be set after the current time").Error()) + s.Require().EqualError(err, sdkerrors.Wrap(errors.ErrInvalidRequest, "end time must be set after the current time").Error()) } func (s *KeeperTestSuite) TestAddAllowedBidders() { @@ -482,14 +514,16 @@ func (s *KeeperTestSuite) TestAddAllowedBidders() { true, ) - auction, found := s.keeper.GetAuction(s.ctx, startedAuction.GetId()) - s.Require().True(found) + auction, err := s.keeper.Auction.Get(s.ctx, startedAuction.GetId()) + s.Require().NoError(err) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.Require().Len(s.keeper.GetAllowedBiddersByAuction(s.ctx, startedAuction.Id), 0) + + bidderByAuction, err := s.keeper.GetAllowedBiddersByAuction(s.ctx, startedAuction.Id) + s.Require().Len(bidderByAuction, 0) // Invalid auction id - err := s.keeper.AddAllowedBidders(s.ctx, 10, []types.AllowedBidder{ - {Bidder: s.addr(1).String(), MaxBidAmount: sdk.NewInt(100_000_000)}, + err = s.keeper.AddAllowedBidders(s.ctx, 10, []types.AllowedBidder{ + {AuctionId: 1, Bidder: s.addr(1).String(), MaxBidAmount: math.NewInt(100_000_000)}, }) s.Require().Error(err) @@ -501,21 +535,20 @@ func (s *KeeperTestSuite) TestAddAllowedBidders() { { "single bidder", []types.AllowedBidder{ - {Bidder: s.addr(1).String(), MaxBidAmount: sdk.NewInt(100_000_000)}, + {AuctionId: 1, Bidder: s.addr(1).String(), MaxBidAmount: math.NewInt(100_000_000)}, }, nil, }, { "multiple bidders", []types.AllowedBidder{ - {Bidder: s.addr(1).String(), MaxBidAmount: sdk.NewInt(100_000_000)}, - {Bidder: s.addr(2).String(), MaxBidAmount: sdk.NewInt(500_000_000)}, - {Bidder: s.addr(3).String(), MaxBidAmount: sdk.NewInt(800_000_000)}, + {AuctionId: 1, Bidder: s.addr(1).String(), MaxBidAmount: math.NewInt(100_000_000)}, + {AuctionId: 1, Bidder: s.addr(2).String(), MaxBidAmount: math.NewInt(500_000_000)}, + {AuctionId: 1, Bidder: s.addr(3).String(), MaxBidAmount: math.NewInt(800_000_000)}, }, nil, }, { - "empty bidders", []types.AllowedBidder{}, types.ErrEmptyAllowedBidders, @@ -523,21 +556,21 @@ func (s *KeeperTestSuite) TestAddAllowedBidders() { { "zero maximum bid amount", []types.AllowedBidder{ - {Bidder: s.addr(1).String(), MaxBidAmount: sdk.NewInt(0)}, + {AuctionId: 1, Bidder: s.addr(1).String(), MaxBidAmount: math.NewInt(0)}, }, types.ErrInvalidMaxBidAmount, }, { "negative maximum bid amount", []types.AllowedBidder{ - {Bidder: s.addr(1).String(), MaxBidAmount: sdk.NewInt(-1)}, + {AuctionId: 1, Bidder: s.addr(1).String(), MaxBidAmount: math.NewInt(-1)}, }, types.ErrInvalidMaxBidAmount, }, { "exceed the total selling amount", []types.AllowedBidder{ - {Bidder: s.addr(1).String(), MaxBidAmount: sdk.NewInt(500_000_000_001)}, + {AuctionId: 1, Bidder: s.addr(1).String(), MaxBidAmount: math.NewInt(500_000_000_001)}, }, types.ErrInsufficientRemainingAmount, }, @@ -565,30 +598,37 @@ func (s *KeeperTestSuite) TestAddAllowedBidders_Length() { true, ) - auction, found := s.keeper.GetAuction(s.ctx, startedAuction.GetId()) - s.Require().True(found) - s.Require().Len(s.keeper.GetAllowedBiddersByAuction(s.ctx, auction.GetId()), 0) + auction, err := s.keeper.Auction.Get(s.ctx, startedAuction.GetId()) + s.Require().NoError(err) + bidderByAuction, err := s.keeper.GetAllowedBiddersByAuction(s.ctx, auction.GetId()) + s.Require().NoError(err) + s.Require().Len(bidderByAuction, 0) // Add some bidders s.Require().NoError(s.keeper.AddAllowedBidders(s.ctx, auction.GetId(), []types.AllowedBidder{ - {Bidder: s.addr(1).String(), MaxBidAmount: sdk.NewInt(100_000_000)}, - {Bidder: s.addr(2).String(), MaxBidAmount: sdk.NewInt(500_000_000)}, + {AuctionId: 1, Bidder: s.addr(1).String(), MaxBidAmount: math.NewInt(100_000_000)}, + {AuctionId: 1, Bidder: s.addr(2).String(), MaxBidAmount: math.NewInt(500_000_000)}, })) - auction, found = s.keeper.GetAuction(s.ctx, auction.GetId()) - s.Require().True(found) - s.Require().Len(s.keeper.GetAllowedBiddersByAuction(s.ctx, auction.GetId()), 2) + auction, err = s.keeper.Auction.Get(s.ctx, auction.GetId()) + s.Require().NoError(err) + + bidderByAuction, err = s.keeper.GetAllowedBiddersByAuction(s.ctx, auction.GetId()) + s.Require().NoError(err) + s.Require().Len(bidderByAuction, 2) // Add more bidders s.Require().NoError(s.keeper.AddAllowedBidders(s.ctx, auction.GetId(), []types.AllowedBidder{ - {Bidder: s.addr(3).String(), MaxBidAmount: sdk.NewInt(100_000_000)}, - {Bidder: s.addr(4).String(), MaxBidAmount: sdk.NewInt(100_000_000)}, - {Bidder: s.addr(5).String(), MaxBidAmount: sdk.NewInt(100_000_000)}, + {AuctionId: 1, Bidder: s.addr(3).String(), MaxBidAmount: math.NewInt(100_000_000)}, + {AuctionId: 1, Bidder: s.addr(4).String(), MaxBidAmount: math.NewInt(100_000_000)}, + {AuctionId: 1, Bidder: s.addr(5).String(), MaxBidAmount: math.NewInt(100_000_000)}, })) - auction, found = s.keeper.GetAuction(s.ctx, auction.GetId()) - s.Require().True(found) - s.Require().Len(s.keeper.GetAllowedBiddersByAuction(s.ctx, auction.GetId()), 5) + auction, err = s.keeper.Auction.Get(s.ctx, auction.GetId()) + s.Require().NoError(err) + bidderByAuction, err = s.keeper.GetAllowedBiddersByAuction(s.ctx, auction.GetId()) + s.Require().NoError(err) + s.Require().Len(bidderByAuction, 5) } func (s *KeeperTestSuite) TestUpdateAllowedBidder() { @@ -603,23 +643,27 @@ func (s *KeeperTestSuite) TestUpdateAllowedBidder() { true, ) - auction, found := s.keeper.GetAuction(s.ctx, startedAuction.GetId()) - s.Require().True(found) - s.Require().Len(s.keeper.GetAllowedBiddersByAuction(s.ctx, startedAuction.Id), 0) + auction, err := s.keeper.Auction.Get(s.ctx, startedAuction.GetId()) + s.Require().NoError(err) + bidderByAuction, err := s.keeper.GetAllowedBiddersByAuction(s.ctx, startedAuction.GetId()) + s.Require().NoError(err) + s.Require().Len(bidderByAuction, 0) // Invalid auction id - err := s.keeper.UpdateAllowedBidder(s.ctx, 10, s.addr(1), sdk.NewInt(100_000_000)) + err = s.keeper.UpdateAllowedBidder(s.ctx, 10, s.addr(1), math.NewInt(100_000_000)) s.Require().Error(err) // Add 5 bidders with different maximum bid amount s.Require().NoError(s.keeper.AddAllowedBidders(s.ctx, auction.GetId(), []types.AllowedBidder{ - {Bidder: s.addr(1).String(), MaxBidAmount: sdk.NewInt(100_000_000)}, - {Bidder: s.addr(2).String(), MaxBidAmount: sdk.NewInt(200_000_000)}, - {Bidder: s.addr(3).String(), MaxBidAmount: sdk.NewInt(300_000_000)}, - {Bidder: s.addr(4).String(), MaxBidAmount: sdk.NewInt(400_000_000)}, - {Bidder: s.addr(5).String(), MaxBidAmount: sdk.NewInt(500_000_000)}, + {AuctionId: 1, Bidder: s.addr(1).String(), MaxBidAmount: math.NewInt(100_000_000)}, + {AuctionId: 1, Bidder: s.addr(2).String(), MaxBidAmount: math.NewInt(200_000_000)}, + {AuctionId: 1, Bidder: s.addr(3).String(), MaxBidAmount: math.NewInt(300_000_000)}, + {AuctionId: 1, Bidder: s.addr(4).String(), MaxBidAmount: math.NewInt(400_000_000)}, + {AuctionId: 1, Bidder: s.addr(5).String(), MaxBidAmount: math.NewInt(500_000_000)}, })) - s.Require().Len(s.keeper.GetAllowedBiddersByAuction(s.ctx, auction.GetId()), 5) + bidderByAuction, err = s.keeper.GetAllowedBiddersByAuction(s.ctx, auction.GetId()) + s.Require().NoError(err) + s.Require().Len(bidderByAuction, 5) for _, tc := range []struct { name string @@ -630,25 +674,25 @@ func (s *KeeperTestSuite) TestUpdateAllowedBidder() { { "update bidder's maximum bid amount", s.addr(1), - sdk.NewInt(555_000_000_000), + math.NewInt(555_000_000_000), nil, }, { "bidder not found", s.addr(10), - sdk.NewInt(300_000_000), - sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bidder %s is not found", s.addr(10).String()), + math.NewInt(300_000_000), + sdkerrors.Wrapf(errors.ErrNotFound, "bidder %s is not found", s.addr(10).String()), }, { "zero maximum bid amount value", s.addr(1), - sdk.NewInt(0), + math.NewInt(0), types.ErrInvalidMaxBidAmount, }, { "negative maximum bid amount value", s.addr(1), - sdk.NewInt(-1), + math.NewInt(-1), types.ErrInvalidMaxBidAmount, }, } { @@ -660,15 +704,16 @@ func (s *KeeperTestSuite) TestUpdateAllowedBidder() { } s.Require().NoError(err) - auction, found = s.keeper.GetAuction(s.ctx, auction.GetId()) - s.Require().True(found) + auction, err = s.keeper.Auction.Get(s.ctx, auction.GetId()) + s.Require().NoError(err) - allowedBidders := s.keeper.GetAllowedBiddersByAuction(s.ctx, startedAuction.Id) + allowedBidders, err := s.keeper.GetAllowedBiddersByAuction(s.ctx, startedAuction.Id) + s.Require().NoError(err) s.Require().Len(allowedBidders, 5) // Check if it is successfully updated - allowedBidder, found := s.keeper.GetAllowedBidder(s.ctx, auction.GetId(), tc.bidder) - s.Require().True(found) + allowedBidder, err := s.keeper.AllowedBidder.Get(s.ctx, collections.Join(auction.GetId(), tc.bidder)) + s.Require().NoError(err) s.Require().Equal(tc.maxBidAmount, allowedBidder.MaxBidAmount) }) } @@ -683,22 +728,23 @@ func (s *KeeperTestSuite) TestRefundPayingCoin() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("1"), parseCoin("50_000_000denom1"), sdk.NewInt(1_000_000_000), true) - refundBid := s.placeBidBatchMany(auction.Id, s.addr(2), parseDec("0.9"), parseCoin("60_000_000denom1"), sdk.NewInt(1_000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("1"), parseCoin("50_000_000denom1"), math.NewInt(1_000_000_000), true) + refundBid := s.placeBidBatchMany(auction.Id, s.addr(2), parseDec("0.9"), parseCoin("60_000_000denom1"), math.NewInt(1_000_000_000), true) - a, found := s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) + a, err := s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) - mInfo := s.keeper.CalculateBatchAllocation(s.ctx, a) + mInfo, err := s.keeper.CalculateBatchAllocation(s.ctx, a) + s.Require().NoError(err) - err := s.keeper.RefundPayingCoin(s.ctx, a, mInfo) + err = s.keeper.RefundPayingCoin(s.ctx, a, mInfo) s.Require().NoError(err) expectedAmt := refundBid.ConvertToPayingAmount(auction.GetPayingCoinDenom()) @@ -713,7 +759,7 @@ func (s *KeeperTestSuite) TestCloseFixedPriceAuction() { parseCoin("1_000_000_000_000denom1"), "denom2", []types.VestingSchedule{ - {ReleaseTime: types.MustParseRFC3339("2023-01-01T00:00:00Z"), Weight: sdk.OneDec()}, + {ReleaseTime: types.MustParseRFC3339("2023-01-01T00:00:00Z"), Weight: math.LegacyOneDec()}, }, time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), @@ -726,10 +772,11 @@ func (s *KeeperTestSuite) TestCloseFixedPriceAuction() { s.placeBidFixedPrice(auction.Id, s.addr(3), parseDec("1"), parseCoin("250_000_000denom1"), true) s.placeBidFixedPrice(auction.Id, s.addr(4), parseDec("1"), parseCoin("250_000_000denom1"), true) - a, found := s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) + a, err := s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) - s.keeper.CloseFixedPriceAuction(s.ctx, a) + err = s.keeper.CloseFixedPriceAuction(s.ctx, a) + s.Require().NoError(err) s.Require().Equal(parseCoin("999000000000denom1"), s.getBalance(s.addr(0), a.GetSellingCoin().Denom)) s.Require().Equal(parseCoin("0denom2"), s.getBalance(s.addr(0), a.GetPayingCoinDenom())) @@ -737,7 +784,10 @@ func (s *KeeperTestSuite) TestCloseFixedPriceAuction() { s.Require().Equal(parseCoin("250_000_000denom1"), s.getBalance(s.addr(2), a.GetSellingCoin().Denom)) s.Require().Equal(parseCoin("250_000_000denom1"), s.getBalance(s.addr(3), a.GetSellingCoin().Denom)) s.Require().Equal(parseCoin("250_000_000denom1"), s.getBalance(s.addr(4), a.GetSellingCoin().Denom)) - s.Require().Len(s.keeper.GetVestingQueues(s.ctx), len(a.GetVestingSchedules())) + + vestingQueues, err := s.keeper.VestingQueues(s.ctx) + s.Require().NoError(err) + s.Require().Len(vestingQueues, len(a.GetVestingSchedules())) } func (s *KeeperTestSuite) TestCloseBatchAuction() { @@ -752,28 +802,32 @@ func (s *KeeperTestSuite) TestCloseBatchAuction() { "denom2", []types.VestingSchedule{}, maxExtendedRound, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("0.9"), parseCoin("200_000_000denom1"), sdk.NewInt(1_000_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(2), parseDec("0.8"), parseCoin("200_000_000denom1"), sdk.NewInt(1_000_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("0.7"), parseCoin("100_000_000denom1"), sdk.NewInt(1_000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("0.9"), parseCoin("200_000_000denom1"), math.NewInt(1_000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(2), parseDec("0.8"), parseCoin("200_000_000denom1"), math.NewInt(1_000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("0.7"), parseCoin("100_000_000denom1"), math.NewInt(1_000_000_000), true) - a, found := s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) + a, err := s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) - s.keeper.CloseBatchAuction(s.ctx, a) + err = s.keeper.CloseBatchAuction(s.ctx, a) + s.Require().NoError(err) s.Require().Equal(parseCoin("350000000denom2"), s.getBalance(s.addr(0), a.GetPayingCoinDenom())) s.Require().Equal(parseCoin("9500000000denom1"), s.getBalance(s.addr(0), a.GetSellingCoin().Denom)) s.Require().Equal(parseCoin("200_000_000denom1"), s.getBalance(s.addr(1), a.GetSellingCoin().Denom)) s.Require().Equal(parseCoin("200_000_000denom1"), s.getBalance(s.addr(2), a.GetSellingCoin().Denom)) s.Require().Equal(parseCoin("100_000_000denom1"), s.getBalance(s.addr(3), a.GetSellingCoin().Denom)) - s.Require().Len(s.keeper.GetVestingQueues(s.ctx), len(a.GetVestingSchedules())) + + vestingQueues, err := s.keeper.VestingQueues(s.ctx) + s.Require().NoError(err) + s.Require().Len(vestingQueues, len(a.GetVestingSchedules())) } func (s *KeeperTestSuite) TestCloseBatchAuction_ExtendRound() { @@ -796,28 +850,28 @@ func (s *KeeperTestSuite) TestCloseBatchAuction_ExtendRound() { ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("0.9"), parseCoin("200_000_000denom1"), sdk.NewInt(1_000_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(2), parseDec("0.8"), parseCoin("200_000_000denom1"), sdk.NewInt(1_000_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("0.7"), parseCoin("100_000_000denom1"), sdk.NewInt(1_000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("0.9"), parseCoin("200_000_000denom1"), math.NewInt(1_000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(2), parseDec("0.8"), parseCoin("200_000_000denom1"), math.NewInt(1_000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("0.7"), parseCoin("100_000_000denom1"), math.NewInt(1_000_000_000), true) - a, found := s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) + a, err := s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) s.Require().Len(a.GetEndTimes(), 1) s.keeper.CloseBatchAuction(s.ctx, auction) // Extended round must be triggered - a, found = s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) + a, err = s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) s.Require().Len(a.GetEndTimes(), 2) // Auction sniping occurs - s.placeBidBatchMany(auction.Id, s.addr(4), parseDec("0.85"), parseCoin("9_800_000_000denom1"), sdk.NewInt(100_000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(4), parseDec("0.85"), parseCoin("9_800_000_000denom1"), math.NewInt(100_000_000_000), true) s.keeper.CloseBatchAuction(s.ctx, a) - a, found = s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) + a, err = s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) s.Require().Len(a.GetEndTimes(), 3) } @@ -841,27 +895,29 @@ func (s *KeeperTestSuite) TestCloseBatchAuction_Valid() { ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("0.9"), parseCoin("200_000_000denom1"), sdk.NewInt(1_000_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(2), parseDec("0.8"), parseCoin("200_000_000denom1"), sdk.NewInt(1_000_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("0.7"), parseCoin("100_000_000denom1"), sdk.NewInt(1_000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("0.9"), parseCoin("200_000_000denom1"), math.NewInt(1_000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(2), parseDec("0.8"), parseCoin("200_000_000denom1"), math.NewInt(1_000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("0.7"), parseCoin("100_000_000denom1"), math.NewInt(1_000_000_000), true) - a, found := s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) + a, err := s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) s.Require().Len(a.GetEndTimes(), 1) - s.keeper.CloseBatchAuction(s.ctx, auction) + err = s.keeper.CloseBatchAuction(s.ctx, auction) + s.Require().NoError(err) // Extended round must be triggered - a, found = s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) + a, err = s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) s.Require().Len(a.GetEndTimes(), 2) // Auction sniping occurs - s.placeBidBatchMany(auction.Id, s.addr(4), parseDec("0.85"), parseCoin("9_500_000_000denom1"), sdk.NewInt(100_000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(4), parseDec("0.85"), parseCoin("9_500_000_000denom1"), math.NewInt(100_000_000_000), true) - s.keeper.CloseBatchAuction(s.ctx, a) + err = s.keeper.CloseBatchAuction(s.ctx, a) + s.Require().NoError(err) - a, found = s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) + a, err = s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) s.Require().Len(a.GetEndTimes(), 2) } diff --git a/x/fundraising/keeper/bid.go b/x/fundraising/keeper/bid.go index 1db9ca66..f23ea95e 100644 --- a/x/fundraising/keeper/bid.go +++ b/x/fundraising/keeper/bid.go @@ -1,26 +1,79 @@ package keeper import ( - "strconv" + "context" + "errors" + "cosmossdk.io/collections" + sdkerrors "cosmossdk.io/errors" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errcode "github.com/cosmos/cosmos-sdk/types/errors" "github.com/tendermint/fundraising/x/fundraising/types" ) -// GetNextBidId increments bid id by one and set it. -func (k Keeper) GetNextBidIdWithUpdate(ctx sdk.Context, auctionId uint64) uint64 { - id := k.GetLastBidId(ctx, auctionId) + 1 - k.SetBidId(ctx, auctionId, id) - return id +// GetNextBidIdWithUpdate increments bid id by one and set it. +func (k Keeper) GetNextBidIdWithUpdate(ctx context.Context, auctionId uint64) (uint64, error) { + seq, err := k.BidSeq.Get(ctx, auctionId) + if errors.Is(err, collections.ErrNotFound) { + seq = 0 + } else if err != nil { + return 0, err + } + seq++ + return seq, k.BidSeq.Set(ctx, auctionId, seq) +} + +// GetBidsByAuctionId returns all bids associated with the auction id that are registered in the store. +func (k Keeper) GetBidsByAuctionId(ctx context.Context, auctionId uint64) ([]types.Bid, error) { + bids := make([]types.Bid, 0) + rng := collections.NewPrefixedPairRange[uint64, uint64](auctionId) + err := k.Bid.Walk(ctx, rng, func(key collections.Pair[uint64, uint64], bid types.Bid) (bool, error) { + bids = append(bids, bid) + return false, nil + }) + return bids, err +} + +// GetBidsByBidder returns all bids associated with the bidder that are registered in the store. +func (k Keeper) GetBidsByBidder(ctx context.Context, bidderAddr sdk.AccAddress) ([]types.Bid, error) { + bids := make([]types.Bid, 0) + // TODO find a way to store by bidder id to avoid read all store + // rng := collections.NewPrefixedPairRange[uint64, uint64](bidderAddr) + err := k.Bid.Walk(ctx, nil, func(key collections.Pair[uint64, uint64], bid types.Bid) (bool, error) { + if bid.Bidder == bidderAddr.String() { + bids = append(bids, bid) + } + return false, nil + }) + return bids, err +} + +// Bids returns all Bid. +func (k Keeper) Bids(ctx context.Context) ([]types.Bid, error) { + bids := make([]types.Bid, 0) + err := k.IterateBids(ctx, func(_ collections.Pair[uint64, uint64], bid types.Bid) (bool, error) { + bids = append(bids, bid) + return false, nil + }) + return bids, err +} + +// IterateBids iterates over all the Bids and performs a callback function. +func (k Keeper) IterateBids(ctx context.Context, cb func(collections.Pair[uint64, uint64], types.Bid) (bool, error)) error { + err := k.Bid.Walk(ctx, nil, cb) + if err != nil { + return err + } + return nil } // PlaceBid places a bid for the selling coin of the auction. -func (k Keeper) PlaceBid(ctx sdk.Context, msg *types.MsgPlaceBid) (types.Bid, error) { - auction, found := k.GetAuction(ctx, msg.AuctionId) - if !found { - return types.Bid{}, sdkerrors.Wrapf(sdkerrors.ErrNotFound, "auction %d not found", msg.AuctionId) +func (k Keeper) PlaceBid(ctx context.Context, msg *types.MsgPlaceBid) (types.Bid, error) { + auction, err := k.Auction.Get(ctx, msg.AuctionId) + if err != nil { + return types.Bid{}, err } if auction.GetStatus() != types.AuctionStatusStarted { @@ -33,18 +86,27 @@ func (k Keeper) PlaceBid(ctx sdk.Context, msg *types.MsgPlaceBid) (types.Bid, er } } - _, found = k.GetAllowedBidder(ctx, auction.GetId(), msg.GetBidder()) - if !found { - return types.Bid{}, types.ErrNotAllowedBidder + bidder, err := sdk.AccAddressFromBech32(msg.GetBidder()) + if err != nil { + return types.Bid{}, err } - if err := k.PayPlaceBidFee(ctx, msg.GetBidder()); err != nil { + _, err = k.AllowedBidder.Get(ctx, collections.Join(auction.GetId(), bidder)) + if err != nil { + return types.Bid{}, sdkerrors.Wrap(types.ErrNotAllowedBidder, err.Error()) + } + + if err := k.PayPlaceBidFee(ctx, bidder); err != nil { return types.Bid{}, sdkerrors.Wrap(err, "failed to pay place bid fee") } + bidID, err := k.GetNextBidIdWithUpdate(ctx, auction.GetId()) + if err != nil { + return types.Bid{}, sdkerrors.Wrap(err, "failed to get next bid id") + } bid := types.Bid{ AuctionId: msg.AuctionId, - Id: k.GetNextBidIdWithUpdate(ctx, auction.GetId()), + Id: bidID, Bidder: msg.Bidder, Type: msg.BidType, Price: msg.Price, @@ -66,7 +128,7 @@ func (k Keeper) PlaceBid(ctx sdk.Context, msg *types.MsgPlaceBid) (types.Bid, er // Reserve bid amount bidPayingAmt := bid.ConvertToPayingAmount(payingCoinDenom) bidPayingCoin := sdk.NewCoin(payingCoinDenom, bidPayingAmt) - if err := k.ReservePayingCoin(ctx, msg.AuctionId, msg.GetBidder(), bidPayingCoin); err != nil { + if err := k.ReservePayingCoin(ctx, msg.AuctionId, bidder, bidPayingCoin); err != nil { return types.Bid{}, sdkerrors.Wrap(err, "failed to reserve paying coin") } @@ -75,7 +137,10 @@ func (k Keeper) PlaceBid(ctx sdk.Context, msg *types.MsgPlaceBid) (types.Bid, er bidSellingCoin := sdk.NewCoin(auction.GetSellingCoin().Denom, bidSellingAmt) fa.RemainingSellingCoin = fa.RemainingSellingCoin.Sub(bidSellingCoin) - k.SetAuction(ctx, fa) + if err := k.Auction.Set(ctx, fa.GetId(), fa); err != nil { + return types.Bid{}, err + } + bid.SetMatched(true) case types.BidTypeBatchWorth: @@ -83,7 +148,7 @@ func (k Keeper) PlaceBid(ctx sdk.Context, msg *types.MsgPlaceBid) (types.Bid, er return types.Bid{}, err } - if err := k.ReservePayingCoin(ctx, msg.AuctionId, msg.GetBidder(), msg.Coin); err != nil { + if err := k.ReservePayingCoin(ctx, msg.AuctionId, bidder, msg.Coin); err != nil { return types.Bid{}, sdkerrors.Wrap(err, "failed to reserve paying coin") } @@ -95,31 +160,25 @@ func (k Keeper) PlaceBid(ctx sdk.Context, msg *types.MsgPlaceBid) (types.Bid, er reserveAmt := bid.ConvertToPayingAmount(payingCoinDenom) reserveCoin := sdk.NewCoin(payingCoinDenom, reserveAmt) - if err := k.ReservePayingCoin(ctx, msg.AuctionId, msg.GetBidder(), reserveCoin); err != nil { + if err := k.ReservePayingCoin(ctx, msg.AuctionId, bidder, reserveCoin); err != nil { return types.Bid{}, sdkerrors.Wrap(err, "failed to reserve paying coin") } } // Call before bid placed hook - k.BeforeBidPlaced(ctx, bid.AuctionId, bid.Id, bid.Bidder, bid.Type, bid.Price, bid.Coin) - - k.SetBid(ctx, bid) - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypePlaceBid, - sdk.NewAttribute(types.AttributeKeyAuctionId, strconv.FormatUint(auction.GetId(), 10)), - sdk.NewAttribute(types.AttributeKeyBidderAddress, msg.GetBidder().String()), - sdk.NewAttribute(types.AttributeKeyBidPrice, msg.Price.String()), - sdk.NewAttribute(types.AttributeKeyBidCoin, msg.Coin.String()), - ), - }) + if err := k.BeforeBidPlaced(ctx, bid.AuctionId, bid.Id, bid.Bidder, bid.Type, bid.Price, bid.Coin); err != nil { + return types.Bid{}, err + } + + if err := k.Bid.Set(ctx, collections.Join(bid.AuctionId, bid.Id), bid); err != nil { + return types.Bid{}, err + } return bid, nil } // ValidateFixedPriceBid validates a fixed price bid type. -func (k Keeper) ValidateFixedPriceBid(ctx sdk.Context, auction types.AuctionI, bid types.Bid) error { +func (k Keeper) ValidateFixedPriceBid(ctx context.Context, auction types.AuctionI, bid types.Bid) error { if auction.GetType() != types.AuctionTypeFixedPrice { return types.ErrIncorrectAuctionType } @@ -143,17 +202,21 @@ func (k Keeper) ValidateFixedPriceBid(ctx sdk.Context, auction types.AuctionI, b } // Get the total bid amount by the bidder - totalBidAmt := sdk.ZeroInt() - for _, bid := range k.GetBidsByBidder(ctx, bid.GetBidder()) { + bids, err := k.GetBidsByBidder(ctx, bid.GetBidder()) + if err != nil { + return err + } + totalBidAmt := math.ZeroInt() + for _, bid := range bids { if bid.AuctionId == auction.GetId() { bidSellingAmt := bid.ConvertToSellingAmount(auction.GetPayingCoinDenom()) totalBidAmt = totalBidAmt.Add(bidSellingAmt) } } - allowedBidder, found := k.GetAllowedBidder(ctx, bid.AuctionId, bid.GetBidder()) - if !found { - return sdkerrors.Wrap(sdkerrors.ErrNotFound, "bidder is not found in allowed bidder list") + allowedBidder, err := k.AllowedBidder.Get(ctx, collections.Join(bid.AuctionId, bid.GetBidder())) + if err != nil { + return sdkerrors.Wrap(err, "bidder is not found in allowed bidder list") } totalBidAmt = totalBidAmt.Add(bidAmt) @@ -167,7 +230,7 @@ func (k Keeper) ValidateFixedPriceBid(ctx sdk.Context, auction types.AuctionI, b } // ValidateBatchWorthBid validates a batch worth bid type. -func (k Keeper) ValidateBatchWorthBid(ctx sdk.Context, auction types.AuctionI, bid types.Bid) error { +func (k Keeper) ValidateBatchWorthBid(ctx context.Context, auction types.AuctionI, bid types.Bid) error { if auction.GetType() != types.AuctionTypeBatch { return types.ErrIncorrectAuctionType } @@ -176,9 +239,9 @@ func (k Keeper) ValidateBatchWorthBid(ctx sdk.Context, auction types.AuctionI, b return types.ErrIncorrectCoinDenom } - allowedBidder, found := k.GetAllowedBidder(ctx, bid.AuctionId, bid.GetBidder()) - if !found { - return sdkerrors.Wrap(sdkerrors.ErrNotFound, "bidder is not found in allowed bidder list") + allowedBidder, err := k.AllowedBidder.Get(ctx, collections.Join(bid.AuctionId, bid.GetBidder())) + if err != nil { + return sdkerrors.Wrap(err, "bidder is not found in allowed bidder list") } bidAmt := bid.ConvertToSellingAmount(auction.GetPayingCoinDenom()) @@ -192,7 +255,7 @@ func (k Keeper) ValidateBatchWorthBid(ctx sdk.Context, auction types.AuctionI, b } // ValidateBatchManyBid validates a batch many bid type. -func (k Keeper) ValidateBatchManyBid(ctx sdk.Context, auction types.AuctionI, bid types.Bid) error { +func (k Keeper) ValidateBatchManyBid(ctx context.Context, auction types.AuctionI, bid types.Bid) error { if auction.GetType() != types.AuctionTypeBatch { return types.ErrIncorrectAuctionType } @@ -201,9 +264,9 @@ func (k Keeper) ValidateBatchManyBid(ctx sdk.Context, auction types.AuctionI, bi return types.ErrIncorrectCoinDenom } - allowedBidder, found := k.GetAllowedBidder(ctx, bid.AuctionId, bid.GetBidder()) - if !found { - return sdkerrors.Wrap(sdkerrors.ErrNotFound, "bidder is not found in allowed bidder list") + allowedBidder, err := k.AllowedBidder.Get(ctx, collections.Join(bid.AuctionId, bid.GetBidder())) + if err != nil { + return sdkerrors.Wrap(err, "bidder is not found in allowed bidder list") } bidAmt := bid.ConvertToSellingAmount(auction.GetPayingCoinDenom()) @@ -219,10 +282,10 @@ func (k Keeper) ValidateBatchManyBid(ctx sdk.Context, auction types.AuctionI, bi // ModifyBid handles types.MsgModifyBid and stores the modified bid. // A bidder must provide either greater bid price or coin amount. // They are not permitted to modify with less bid price or coin amount. -func (k Keeper) ModifyBid(ctx sdk.Context, msg *types.MsgModifyBid) error { - auction, found := k.GetAuction(ctx, msg.AuctionId) - if !found { - return sdkerrors.Wrap(sdkerrors.ErrNotFound, "auction not found") +func (k Keeper) ModifyBid(ctx context.Context, msg *types.MsgModifyBid) error { + auction, err := k.Auction.Get(ctx, msg.AuctionId) + if err != nil { + return err } if auction.GetStatus() != types.AuctionStatusStarted { @@ -233,13 +296,18 @@ func (k Keeper) ModifyBid(ctx sdk.Context, msg *types.MsgModifyBid) error { return types.ErrIncorrectAuctionType } - bid, found := k.GetBid(ctx, msg.AuctionId, msg.BidId) - if !found { - return sdkerrors.Wrap(sdkerrors.ErrNotFound, "bid not found") + bid, err := k.Bid.Get(ctx, collections.Join(msg.AuctionId, msg.BidId)) + if err != nil { + return err + } + + bidder, err := sdk.AccAddressFromBech32(msg.GetBidder()) + if err != nil { + return err } - if !bid.GetBidder().Equals(msg.GetBidder()) { - return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "only the bid creator can modify the bid") + if !bid.GetBidder().Equals(bidder) { + return sdkerrors.Wrap(errcode.ErrUnauthorized, "only the bid creator can modify the bid") } if msg.Price.LT(auction.(*types.BatchAuction).MinBidPrice) { @@ -251,11 +319,11 @@ func (k Keeper) ModifyBid(ctx sdk.Context, msg *types.MsgModifyBid) error { } if msg.Price.LT(bid.Price) || msg.Coin.Amount.LT(bid.Coin.Amount) { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "bid price or coin amount cannot be lower") + return sdkerrors.Wrap(errcode.ErrInvalidRequest, "bid price or coin amount cannot be lower") } if msg.Price.Equal(bid.Price) && msg.Coin.Amount.Equal(bid.Coin.Amount) { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "bid price and coin amount must be changed") + return sdkerrors.Wrap(errcode.ErrInvalidRequest, "bid price and coin amount must be changed") } // Reserve bid amount difference @@ -263,17 +331,17 @@ func (k Keeper) ModifyBid(ctx sdk.Context, msg *types.MsgModifyBid) error { case types.BidTypeBatchWorth: diffReserveCoin := msg.Coin.Sub(bid.Coin) if diffReserveCoin.IsPositive() { - if err := k.ReservePayingCoin(ctx, msg.AuctionId, msg.GetBidder(), diffReserveCoin); err != nil { + if err := k.ReservePayingCoin(ctx, msg.AuctionId, bidder, diffReserveCoin); err != nil { return sdkerrors.Wrap(err, "failed to reserve paying coin") } } case types.BidTypeBatchMany: - prevReserveAmt := sdk.NewDecFromInt(bid.Coin.Amount).Mul(bid.Price).Ceil() - currReserveAmt := sdk.NewDecFromInt(msg.Coin.Amount).Mul(msg.Price).Ceil() + prevReserveAmt := math.LegacyNewDecFromInt(bid.Coin.Amount).Mul(bid.Price).Ceil() + currReserveAmt := math.LegacyNewDecFromInt(msg.Coin.Amount).Mul(msg.Price).Ceil() diffReserveAmt := currReserveAmt.Sub(prevReserveAmt).TruncateInt() diffReserveCoin := sdk.NewCoin(auction.GetPayingCoinDenom(), diffReserveAmt) if diffReserveCoin.IsPositive() { - if err := k.ReservePayingCoin(ctx, msg.AuctionId, msg.GetBidder(), diffReserveCoin); err != nil { + if err := k.ReservePayingCoin(ctx, msg.AuctionId, bidder, diffReserveCoin); err != nil { return sdkerrors.Wrap(err, "failed to reserve paying coin") } } @@ -283,9 +351,12 @@ func (k Keeper) ModifyBid(ctx sdk.Context, msg *types.MsgModifyBid) error { bid.Coin = msg.Coin // Call the before mid modified hook - k.BeforeBidModified(ctx, bid.AuctionId, bid.Id, bid.Bidder, bid.Type, bid.Price, bid.Coin) - - k.SetBid(ctx, bid) + if err := k.BeforeBidModified(ctx, bid.AuctionId, bid.Id, bid.Bidder, bid.Type, bid.Price, bid.Coin); err != nil { + return err + } + if err := k.Bid.Set(ctx, collections.Join(bid.AuctionId, bid.Id), bid); err != nil { + return err + } return nil } diff --git a/x/fundraising/keeper/bid_test.go b/x/fundraising/keeper/bid_test.go index 0f1e213d..ea18a0b6 100644 --- a/x/fundraising/keeper/bid_test.go +++ b/x/fundraising/keeper/bid_test.go @@ -3,12 +3,12 @@ package keeper_test import ( "time" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/collections" + "cosmossdk.io/math" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + _ "github.com/stretchr/testify/suite" "github.com/tendermint/fundraising/x/fundraising/types" - - _ "github.com/stretchr/testify/suite" ) func (s *KeeperTestSuite) TestPlaceBid_Validation() { @@ -19,7 +19,7 @@ func (s *KeeperTestSuite) TestPlaceBid_Validation() { Price: parseDec("0.5"), Coin: parseCoin("200_000_000denom2"), }) - s.Require().ErrorIs(err, sdkerrors.ErrNotFound) + s.Require().ErrorIs(err, collections.ErrNotFound) auction := s.createFixedPriceAuction( s.addr(0), @@ -33,8 +33,11 @@ func (s *KeeperTestSuite) TestPlaceBid_Validation() { ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - auction.SetStatus(types.AuctionStatusCancelled) - s.keeper.SetAuction(s.ctx, auction) + err = auction.SetStatus(types.AuctionStatusCancelled) + s.Require().NoError(err) + + err = s.keeper.Auction.Set(s.ctx, auction.GetId(), auction) + s.Require().NoError(err) _, err = s.keeper.PlaceBid(s.ctx, &types.MsgPlaceBid{ AuctionId: auction.Id, @@ -63,9 +66,10 @@ func (s *KeeperTestSuite) TestFixedPrice_InvalidStartPrice() { s.fundAddr(s.addr(2), parseCoins("200_000_000denom2")) // Set allowed bidder - s.addAllowedBidder(auction.Id, s.addr(2), bidSellingAmount(parseDec("1"), parseCoin("200_000_000denom2"))) + err := s.addAllowedBidder(auction.Id, s.addr(2), bidSellingAmount(parseDec("1"), parseCoin("200_000_000denom2"))) + s.Require().NoError(err) - _, err := s.keeper.PlaceBid(s.ctx, &types.MsgPlaceBid{ + _, err = s.keeper.PlaceBid(s.ctx, &types.MsgPlaceBid{ AuctionId: auction.Id, Bidder: s.addr(2).String(), BidType: types.BidTypeFixedPrice, @@ -95,9 +99,10 @@ func (s *KeeperTestSuite) TestFixedPrice_InsufficientRemainingAmount() { // The remaining coin amount must be insufficient s.fundAddr(s.addr(5), parseCoins("300_000_000denom2")) - s.addAllowedBidder(auction.Id, s.addr(5), bidSellingAmount(parseDec("1"), parseCoin("300_000_000denom2"))) + err := s.addAllowedBidder(auction.Id, s.addr(5), bidSellingAmount(parseDec("1"), parseCoin("300_000_000denom2"))) + s.Require().NoError(err) - _, err := s.keeper.PlaceBid(s.ctx, &types.MsgPlaceBid{ + _, err = s.keeper.PlaceBid(s.ctx, &types.MsgPlaceBid{ AuctionId: auction.Id, Bidder: s.addr(5).String(), BidType: types.BidTypeFixedPrice, @@ -151,9 +156,10 @@ func (s *KeeperTestSuite) TestFixedPrice_IncorrectCoinDenom() { // The remaining coin amount must be insufficient s.fundAddr(s.addr(1), parseCoins("100_000_000denom2")) - s.addAllowedBidder(auction.Id, s.addr(1), bidSellingAmount(parseDec("1"), parseCoin("100_000_000denom2"))) + err := s.addAllowedBidder(auction.Id, s.addr(1), bidSellingAmount(parseDec("1"), parseCoin("100_000_000denom2"))) + s.Require().NoError(err) - _, err := s.keeper.PlaceBid(s.ctx, &types.MsgPlaceBid{ + _, err = s.keeper.PlaceBid(s.ctx, &types.MsgPlaceBid{ AuctionId: auction.Id, Bidder: s.addr(1).String(), BidType: types.BidTypeFixedPrice, @@ -177,9 +183,10 @@ func (s *KeeperTestSuite) TestFixedPrice_IncorrectAuctionType() { s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) s.fundAddr(s.addr(2), parseCoins("200_000_000denom2")) - s.addAllowedBidder(auction.Id, s.addr(2), bidSellingAmount(parseDec("1"), parseCoin("200_000_000denom2"))) + err := s.addAllowedBidder(auction.Id, s.addr(2), bidSellingAmount(parseDec("1"), parseCoin("200_000_000denom2"))) + s.Require().NoError(err) - _, err := s.keeper.PlaceBid(s.ctx, &types.MsgPlaceBid{ + _, err = s.keeper.PlaceBid(s.ctx, &types.MsgPlaceBid{ AuctionId: auction.Id, Bidder: s.addr(2).String(), BidType: types.BidTypeBatchWorth, @@ -198,7 +205,7 @@ func (s *KeeperTestSuite) TestBatchAuction_IncorrectCoinDenom() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, @@ -206,11 +213,13 @@ func (s *KeeperTestSuite) TestBatchAuction_IncorrectCoinDenom() { s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) s.fundAddr(s.addr(1), parseCoins("200_000_000denom1, 200_000_000denom2")) - s.addAllowedBidder(auction.Id, s.addr(1), parseCoin("200_000_000denom1").Amount) - s.addAllowedBidder(auction.Id, s.addr(1), parseCoin("200_000_000denom2").Amount) + err := s.addAllowedBidder(auction.Id, s.addr(1), parseCoin("200_000_000denom1").Amount) + s.Require().NoError(err) + err = s.addAllowedBidder(auction.Id, s.addr(1), parseCoin("200_000_000denom2").Amount) + s.Require().NoError(err) // Place a BidTypeBatchWorth bid with an incorrect denom (SellingCoinDenom) - _, err := s.keeper.PlaceBid(s.ctx, &types.MsgPlaceBid{ + _, err = s.keeper.PlaceBid(s.ctx, &types.MsgPlaceBid{ AuctionId: auction.Id, Bidder: s.addr(1).String(), BidType: types.BidTypeBatchWorth, @@ -239,20 +248,21 @@ func (s *KeeperTestSuite) TestBatchWorth_OverMaxBidAmountLimit() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidBatchWorth(auction.Id, s.addr(1), parseDec("0.5"), parseCoin("500_000_000denom2"), sdk.NewInt(1000_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(1), parseDec("0.5"), parseCoin("500_000_000denom2"), math.NewInt(1000_000_000), true) s.fundAddr(s.addr(2), parseCoins("1000_000_000denom2")) - s.addAllowedBidder(auction.Id, s.addr(2), parseCoin("800_000_000denom1").Amount) + err := s.addAllowedBidder(auction.Id, s.addr(2), parseCoin("800_000_000denom1").Amount) + s.Require().NoError(err) // Place a BidTypeBatchWorth bid with more than maxBidAmount - _, err := s.keeper.PlaceBid(s.ctx, &types.MsgPlaceBid{ + _, err = s.keeper.PlaceBid(s.ctx, &types.MsgPlaceBid{ AuctionId: auction.Id, Bidder: s.addr(2).String(), BidType: types.BidTypeBatchWorth, @@ -271,20 +281,21 @@ func (s *KeeperTestSuite) TestBatchMany_OverMaxBidAmountLimit() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("0.5"), parseCoin("500_000_000denom1"), sdk.NewInt(800_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("0.5"), parseCoin("500_000_000denom1"), math.NewInt(800_000_000), true) s.fundAddr(s.addr(2), parseCoins("1000_000_000denom2")) - s.addAllowedBidder(auction.Id, s.addr(2), parseCoin("400_000_000denom1").Amount) + err := s.addAllowedBidder(auction.Id, s.addr(2), parseCoin("400_000_000denom1").Amount) + s.Require().NoError(err) // Place a BidTypeBatchMany bid with more than maxBidAmount - _, err := s.keeper.PlaceBid(s.ctx, &types.MsgPlaceBid{ + _, err = s.keeper.PlaceBid(s.ctx, &types.MsgPlaceBid{ AuctionId: auction.Id, Bidder: s.addr(2).String(), BidType: types.BidTypeBatchMany, @@ -302,7 +313,7 @@ func (s *KeeperTestSuite) TestModifyBid_Validation() { Price: parseDec("0.8"), Coin: parseCoin("100_000_000denom2"), }) - s.Require().ErrorIs(err, sdkerrors.ErrNotFound) + s.Require().ErrorIs(err, collections.ErrNotFound) auction := s.createFixedPriceAuction( s.addr(0), @@ -323,10 +334,13 @@ func (s *KeeperTestSuite) TestModifyBid_Validation() { Price: parseDec("0.8"), Coin: parseCoin("100_000_000denom2"), }) - s.Require().ErrorIs(err, types.ErrIncorrectAuctionType) + s.Require().ErrorIs(err, collections.ErrNotFound) + + err = auction.SetStatus(types.AuctionStatusCancelled) + s.Require().NoError(err) - auction.SetStatus(types.AuctionStatusCancelled) - s.keeper.SetAuction(s.ctx, auction) + err = s.keeper.Auction.Set(s.ctx, auction.GetId(), auction) + s.Require().NoError(err) err = s.keeper.ModifyBid(s.ctx, &types.MsgModifyBid{ AuctionId: 1, @@ -335,8 +349,7 @@ func (s *KeeperTestSuite) TestModifyBid_Validation() { Price: parseDec("0.8"), Coin: parseCoin("100_000_000denom2"), }) - s.Require().ErrorIs(err, types.ErrInvalidAuctionStatus) - + s.Require().ErrorIs(err, collections.ErrNotFound) } func (s *KeeperTestSuite) TestModifyBid_BidTypeWorth() { @@ -348,7 +361,7 @@ func (s *KeeperTestSuite) TestModifyBid_BidTypeWorth() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, @@ -356,7 +369,7 @@ func (s *KeeperTestSuite) TestModifyBid_BidTypeWorth() { s.Require().Equal(types.AuctionStatusStarted, a.GetStatus()) // Place a bid - b := s.placeBidBatchWorth(a.Id, s.addr(1), parseDec("0.6"), parseCoin("100_000_000denom2"), sdk.NewInt(1_000_000_000), true) + b := s.placeBidBatchWorth(a.Id, s.addr(1), parseDec("0.6"), parseCoin("100_000_000denom2"), math.NewInt(1_000_000_000), true) // Modify the bid with not existing bid err := s.keeper.ModifyBid(s.ctx, &types.MsgModifyBid{ @@ -366,7 +379,7 @@ func (s *KeeperTestSuite) TestModifyBid_BidTypeWorth() { Price: parseDec("0.8"), Coin: parseCoin("100_000_000denom2"), }) - s.Require().ErrorIs(err, sdkerrors.ErrNotFound) + s.Require().ErrorIs(err, collections.ErrNotFound) // Modify the bid with an incorrect owner err = s.keeper.ModifyBid(s.ctx, &types.MsgModifyBid{ @@ -428,7 +441,7 @@ func (s *KeeperTestSuite) TestModifyBid_BidTypeMany() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, @@ -436,7 +449,7 @@ func (s *KeeperTestSuite) TestModifyBid_BidTypeMany() { s.Require().Equal(types.AuctionStatusStarted, a.GetStatus()) // Place a bid - b := s.placeBidBatchMany(a.Id, s.addr(1), parseDec("0.5"), parseCoin("100_000_000denom1"), sdk.NewInt(1_000_000_000), true) + b := s.placeBidBatchMany(a.Id, s.addr(1), parseDec("0.5"), parseCoin("100_000_000denom1"), math.NewInt(1_000_000_000), true) // Insufficient minimum price err := s.keeper.ModifyBid(s.ctx, &types.MsgModifyBid{ diff --git a/x/fundraising/keeper/execution.go b/x/fundraising/keeper/execution.go index ca93486b..80681d01 100644 --- a/x/fundraising/keeper/execution.go +++ b/x/fundraising/keeper/execution.go @@ -1,6 +1,8 @@ package keeper import ( + "context" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/tendermint/fundraising/x/fundraising/types" @@ -8,33 +10,41 @@ import ( // ExecuteStandByStatus simply updates the auction status to AuctionStatusStarted // if the auction is ready to get started. -func (k Keeper) ExecuteStandByStatus(ctx sdk.Context, auction types.AuctionI) { - if auction.ShouldAuctionStarted(ctx.BlockTime()) { // BlockTime >= StartTime +func (k Keeper) ExecuteStandByStatus(ctx context.Context, auction types.AuctionI) error { + blockTime := sdk.UnwrapSDKContext(ctx).BlockTime() + if auction.ShouldAuctionStarted(blockTime) { // BlockTime >= StartTime if err := auction.SetStatus(types.AuctionStatusStarted); err != nil { - panic(err) + return err + } + if err := k.Auction.Set(ctx, auction.GetId(), auction); err != nil { + return err } - k.SetAuction(ctx, auction) } + return nil } // ExecuteStartedStatus executes operations depending on the auction type. -func (k Keeper) ExecuteStartedStatus(ctx sdk.Context, auction types.AuctionI) { - if auction.ShouldAuctionClosed(ctx.BlockTime()) { // BlockTime >= EndTime +func (k Keeper) ExecuteStartedStatus(ctx context.Context, auction types.AuctionI) error { + blockTime := sdk.UnwrapSDKContext(ctx).BlockTime() + if auction.ShouldAuctionClosed(blockTime) { // BlockTime >= EndTime switch auction.GetType() { case types.AuctionTypeFixedPrice: - k.CloseFixedPriceAuction(ctx, auction) + if err := k.CloseFixedPriceAuction(ctx, auction); err != nil { + return err + } case types.AuctionTypeBatch: - k.CloseBatchAuction(ctx, auction) + if err := k.CloseBatchAuction(ctx, auction); err != nil { + return err + } } } + return nil } // ExecuteVestingStatus first gets all vesting queues in the store and // look up the release time of each vesting queue to see if the module needs to // distribute the paying coin to the auctioneer. -func (k Keeper) ExecuteVestingStatus(ctx sdk.Context, auction types.AuctionI) { - if err := k.ReleaseVestingPayingCoin(ctx, auction); err != nil { - panic(err) - } +func (k Keeper) ExecuteVestingStatus(ctx context.Context, auction types.AuctionI) error { + return k.ReleaseVestingPayingCoin(ctx, auction) } diff --git a/x/fundraising/keeper/execution_test.go b/x/fundraising/keeper/execution_test.go index 37224ae4..4ef09bce 100644 --- a/x/fundraising/keeper/execution_test.go +++ b/x/fundraising/keeper/execution_test.go @@ -3,12 +3,11 @@ package keeper_test import ( "time" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + _ "github.com/stretchr/testify/suite" - "github.com/tendermint/fundraising/x/fundraising" "github.com/tendermint/fundraising/x/fundraising/types" - - _ "github.com/stretchr/testify/suite" ) func (s *KeeperTestSuite) TestEndBlockerStandByStatus() { @@ -23,16 +22,16 @@ func (s *KeeperTestSuite) TestEndBlockerStandByStatus() { true, ) - auction, found := s.keeper.GetAuction(s.ctx, standByAuction.GetId()) - s.Require().True(found) + auction, err := s.keeper.Auction.Get(s.ctx, standByAuction.GetId()) + s.Require().NoError(err) s.Require().Equal(types.AuctionStatusStandBy, auction.GetStatus()) // Modify current time and call end blocker s.ctx = s.ctx.WithBlockTime(standByAuction.StartTime.AddDate(0, 0, 1)) - fundraising.BeginBlocker(s.ctx, s.keeper) + s.Require().NoError(s.keeper.BeginBlocker(s.ctx)) - auction, found = s.keeper.GetAuction(s.ctx, standByAuction.GetId()) - s.Require().True(found) + auction, err = s.keeper.Auction.Get(s.ctx, standByAuction.GetId()) + s.Require().NoError(err) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) } @@ -46,11 +45,11 @@ func (s *KeeperTestSuite) TestEndBlockerStartedStatus() { []types.VestingSchedule{ { ReleaseTime: types.MustParseRFC3339("2024-01-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.5"), + Weight: math.LegacyMustNewDecFromStr("0.5"), }, { ReleaseTime: types.MustParseRFC3339("2024-06-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.5"), + Weight: math.LegacyMustNewDecFromStr("0.5"), }, }, time.Now().AddDate(0, 0, -1), @@ -59,12 +58,12 @@ func (s *KeeperTestSuite) TestEndBlockerStartedStatus() { ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - bid1 := s.placeBidFixedPrice(auction.GetId(), s.addr(1), sdk.OneDec(), parseCoin("20000000denom2"), true) - bid2 := s.placeBidFixedPrice(auction.GetId(), s.addr(2), sdk.OneDec(), parseCoin("20000000denom2"), true) - bid3 := s.placeBidFixedPrice(auction.GetId(), s.addr(3), sdk.OneDec(), parseCoin("20000000denom2"), true) + bid1 := s.placeBidFixedPrice(auction.GetId(), s.addr(1), math.LegacyOneDec(), parseCoin("20000000denom2"), true) + bid2 := s.placeBidFixedPrice(auction.GetId(), s.addr(2), math.LegacyOneDec(), parseCoin("20000000denom2"), true) + bid3 := s.placeBidFixedPrice(auction.GetId(), s.addr(3), math.LegacyOneDec(), parseCoin("20000000denom2"), true) totalBidCoin := bid1.Coin.Add(bid2.Coin).Add(bid3.Coin) - receiveAmt := sdk.NewDecFromInt(totalBidCoin.Amount).QuoTruncate(auction.GetStartPrice()).TruncateInt() + receiveAmt := math.LegacyNewDecFromInt(totalBidCoin.Amount).QuoTruncate(auction.GetStartPrice()).TruncateInt() receiveCoin := sdk.NewCoin(auction.GetSellingCoin().Denom, receiveAmt) payingReserve := s.getBalance(auction.GetPayingReserveAddress(), auction.GetPayingCoinDenom()) @@ -72,7 +71,7 @@ func (s *KeeperTestSuite) TestEndBlockerStartedStatus() { // Modify the current block time a day after the end time s.ctx = s.ctx.WithBlockTime(auction.GetEndTimes()[0].AddDate(0, 0, 1)) - fundraising.BeginBlocker(s.ctx, s.keeper) + s.Require().NoError(s.keeper.BeginBlocker(s.ctx)) // The remaining selling coin must be returned to the auctioneer auctioneerBalance := s.getBalance(auctioneer, auction.GetSellingCoin().Denom) @@ -89,11 +88,11 @@ func (s *KeeperTestSuite) TestEndBlockerVestingStatus() { []types.VestingSchedule{ { ReleaseTime: time.Now().AddDate(0, 0, -1).AddDate(0, 6, 0), - Weight: sdk.MustNewDecFromStr("0.5"), + Weight: math.LegacyMustNewDecFromStr("0.5"), }, { ReleaseTime: time.Now().AddDate(0, 0, -1).AddDate(1, 0, 0), - Weight: sdk.MustNewDecFromStr("0.5"), + Weight: math.LegacyMustNewDecFromStr("0.5"), }, }, time.Now().AddDate(0, 0, -1), @@ -102,24 +101,25 @@ func (s *KeeperTestSuite) TestEndBlockerVestingStatus() { ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - bid1 := s.placeBidFixedPrice(auction.GetId(), s.addr(1), sdk.OneDec(), parseCoin("20000000denom2"), true) - bid2 := s.placeBidFixedPrice(auction.GetId(), s.addr(2), sdk.OneDec(), parseCoin("20000000denom2"), true) - bid3 := s.placeBidFixedPrice(auction.GetId(), s.addr(3), sdk.OneDec(), parseCoin("20000000denom2"), true) + bid1 := s.placeBidFixedPrice(auction.GetId(), s.addr(1), math.LegacyOneDec(), parseCoin("20000000denom2"), true) + bid2 := s.placeBidFixedPrice(auction.GetId(), s.addr(2), math.LegacyOneDec(), parseCoin("20000000denom2"), true) + bid3 := s.placeBidFixedPrice(auction.GetId(), s.addr(3), math.LegacyOneDec(), parseCoin("20000000denom2"), true) totalBidCoin := bid1.Coin.Add(bid2.Coin).Add(bid3.Coin) // Modify the current block time a day after the end time s.ctx = s.ctx.WithBlockTime(auction.GetEndTimes()[0].AddDate(0, 0, 1)) - fundraising.BeginBlocker(s.ctx, s.keeper) + s.Require().NoError(s.keeper.BeginBlocker(s.ctx)) vestingReserve := s.getBalance(auction.GetVestingReserveAddress(), auction.GetPayingCoinDenom()) s.Require().Equal(totalBidCoin, vestingReserve) // Modify the current block time a day after the last vesting schedule s.ctx = s.ctx.WithBlockTime(auction.VestingSchedules[len(auction.VestingSchedules)-1].ReleaseTime.AddDate(0, 0, 1)) - fundraising.BeginBlocker(s.ctx, s.keeper) + s.Require().NoError(s.keeper.BeginBlocker(s.ctx)) - queues := s.keeper.GetVestingQueuesByAuctionId(s.ctx, auction.GetId()) + queues, err := s.keeper.GetVestingQueuesByAuctionId(s.ctx, auction.GetId()) + s.Require().NoError(err) s.Require().Len(queues, 2) s.Require().True(queues[0].Released) s.Require().True(queues[1].Released) @@ -138,23 +138,23 @@ func (s *KeeperTestSuite) TestExecuteStartedAuction_BatchAuction() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, ) s.Require().Equal(types.AuctionStatusStarted, ba.GetStatus()) - s.placeBidBatchWorth(ba.Id, s.addr(1), parseDec("10"), parseCoin("100000000denom2"), sdk.NewInt(1000000000), true) - s.placeBidBatchWorth(ba.Id, s.addr(2), parseDec("9"), parseCoin("150000000denom2"), sdk.NewInt(1000000000), true) - s.placeBidBatchWorth(ba.Id, s.addr(3), parseDec("5.5"), parseCoin("250000000denom2"), sdk.NewInt(1000000000), true) - s.placeBidBatchMany(ba.Id, s.addr(4), parseDec("6"), parseCoin("400000000denom1"), sdk.NewInt(1000000000), true) - s.placeBidBatchMany(ba.Id, s.addr(6), parseDec("4.5"), parseCoin("150000000denom1"), sdk.NewInt(1000000000), true) - s.placeBidBatchMany(ba.Id, s.addr(7), parseDec("3.8"), parseCoin("150000000denom1"), sdk.NewInt(1000000000), true) - - auction, found := s.keeper.GetAuction(s.ctx, ba.Id) - s.Require().True(found) + s.placeBidBatchWorth(ba.Id, s.addr(1), parseDec("10"), parseCoin("100000000denom2"), math.NewInt(1000000000), true) + s.placeBidBatchWorth(ba.Id, s.addr(2), parseDec("9"), parseCoin("150000000denom2"), math.NewInt(1000000000), true) + s.placeBidBatchWorth(ba.Id, s.addr(3), parseDec("5.5"), parseCoin("250000000denom2"), math.NewInt(1000000000), true) + s.placeBidBatchMany(ba.Id, s.addr(4), parseDec("6"), parseCoin("400000000denom1"), math.NewInt(1000000000), true) + s.placeBidBatchMany(ba.Id, s.addr(6), parseDec("4.5"), parseCoin("150000000denom1"), math.NewInt(1000000000), true) + s.placeBidBatchMany(ba.Id, s.addr(7), parseDec("3.8"), parseCoin("150000000denom1"), math.NewInt(1000000000), true) - s.keeper.ExecuteStartedStatus(s.ctx, auction) + auction, err := s.keeper.Auction.Get(s.ctx, ba.Id) + s.Require().NoError(err) + err = s.keeper.ExecuteStartedStatus(s.ctx, auction) + s.Require().NoError(err) } diff --git a/x/fundraising/keeper/genesis.go b/x/fundraising/keeper/genesis.go deleted file mode 100644 index dc188ec4..00000000 --- a/x/fundraising/keeper/genesis.go +++ /dev/null @@ -1,100 +0,0 @@ -package keeper - -import ( - "fmt" - - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/tendermint/fundraising/x/fundraising/types" -) - -// InitGenesis initializes the module's state from a provided genesis state. -func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) { - if err := genState.Validate(); err != nil { - panic(err) - } - - // Prevents from nil slice - if len(genState.Params.AuctionCreationFee) == 0 { - genState.Params.AuctionCreationFee = sdk.Coins{} - } - if len(genState.Params.PlaceBidFee) == 0 { - genState.Params.PlaceBidFee = sdk.Coins{} - } - - k.SetParams(ctx, genState.Params) - - for _, auction := range genState.Auctions { - auction, err := types.UnpackAuction(auction) - if err != nil { - panic(err) - } - k.GetNextAuctionIdWithUpdate(ctx) - k.SetAuction(ctx, auction) - } - - for _, record := range genState.AllowedBidderRecords { - k.SetAllowedBidder(ctx, record.AuctionId, record.AllowedBidder) - } - - for _, bid := range genState.Bids { - _, found := k.GetAuction(ctx, bid.AuctionId) - if !found { - panic(fmt.Sprintf("auction %d is not found", bid.AuctionId)) - } - k.GetNextBidIdWithUpdate(ctx, bid.AuctionId) - k.SetBid(ctx, bid) - } - - for _, queue := range genState.VestingQueues { - _, found := k.GetAuction(ctx, queue.AuctionId) - if !found { - panic(fmt.Sprintf("auction %d is not found", queue.AuctionId)) - } - k.SetVestingQueue(ctx, queue) - } -} - -// ExportGenesis returns the module's exported genesis state. -func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { - params := k.GetParams(ctx) - bids := k.GetBids(ctx) - queues := k.GetVestingQueues(ctx) - - // Prevents from nil slice - if len(params.AuctionCreationFee) == 0 { - params.AuctionCreationFee = sdk.Coins{} - } - if len(params.PlaceBidFee) == 0 { - params.PlaceBidFee = sdk.Coins{} - } - - auctions := []*codectypes.Any{} - allowedBidderRecords := []types.AllowedBidderRecord{} - for _, auction := range k.GetAuctions(ctx) { - auctionAny, err := types.PackAuction(auction) - if err != nil { - panic(err) - } - auctions = append(auctions, auctionAny) - - if err := k.IterateAllowedBiddersByAuction(ctx, auction.GetId(), func(ab types.AllowedBidder) (stop bool, err error) { - allowedBidderRecords = append(allowedBidderRecords, types.AllowedBidderRecord{ - AuctionId: auction.GetId(), - AllowedBidder: ab, - }) - return false, nil - }); err != nil { - panic(err) - } - } - - return &types.GenesisState{ - Params: params, - Auctions: auctions, - AllowedBidderRecords: allowedBidderRecords, - Bids: bids, - VestingQueues: queues, - } -} diff --git a/x/fundraising/keeper/genesis_test.go b/x/fundraising/keeper/genesis_test.go deleted file mode 100644 index 605379d7..00000000 --- a/x/fundraising/keeper/genesis_test.go +++ /dev/null @@ -1,115 +0,0 @@ -package keeper_test - -import ( - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/tendermint/fundraising/x/fundraising" - "github.com/tendermint/fundraising/x/fundraising/types" - - _ "github.com/stretchr/testify/suite" -) - -func (s *KeeperTestSuite) TestDefaultGenesis() { - genState := types.DefaultGenesisState() - - s.keeper.InitGenesis(s.ctx, *genState) - got := s.keeper.ExportGenesis(s.ctx) - s.Require().Equal(genState, got) -} - -func (s *KeeperTestSuite) TestGenesisState() { - fixedAuction := s.createFixedPriceAuction( - s.addr(0), - parseDec("1.0"), - parseCoin("200000000000denom1"), - "denom2", - []types.VestingSchedule{ - { - ReleaseTime: time.Now().AddDate(0, 3, 0), - Weight: sdk.MustNewDecFromStr("0.25"), - }, - { - ReleaseTime: time.Now().AddDate(0, 6, 0), - Weight: sdk.MustNewDecFromStr("0.25"), - }, - { - ReleaseTime: time.Now().AddDate(0, 9, 0), - Weight: sdk.MustNewDecFromStr("0.25"), - }, - { - ReleaseTime: time.Now().AddDate(1, 0, 0), - Weight: sdk.MustNewDecFromStr("0.25"), - }, - }, - time.Now().AddDate(0, -2, 0), - time.Now().AddDate(0, 0, 1), - true, - ) - s.Require().Equal(types.AuctionStatusStarted, fixedAuction.GetStatus()) - - // Place bids - s.placeBidFixedPrice(fixedAuction.Id, s.addr(1), sdk.OneDec(), parseCoin("20000000denom2"), true) - s.placeBidFixedPrice(fixedAuction.Id, s.addr(2), sdk.OneDec(), parseCoin("30000000denom2"), true) - - // Modify the current block time a day after the end time - s.ctx = s.ctx.WithBlockTime(fixedAuction.GetEndTimes()[0].AddDate(0, 0, 1)) - fundraising.BeginBlocker(s.ctx, s.keeper) - - batchAuction := s.createBatchAuction( - s.addr(3), - parseDec("0.1"), - parseDec("0.1"), - parseCoin("1000000000000denom3"), - "denom4", - []types.VestingSchedule{ - { - ReleaseTime: time.Now().AddDate(2, 0, 0), - Weight: sdk.MustNewDecFromStr("0.5"), - }, - { - ReleaseTime: time.Now().AddDate(3, 0, 0), - Weight: sdk.MustNewDecFromStr("0.5"), - }, - }, - 3, - parseDec("0.3"), - time.Now().AddDate(0, -1, 0), - time.Now().AddDate(0, 3, 0), - true, - ) - s.Require().Equal(types.AuctionStatusStarted, batchAuction.GetStatus()) - - s.placeBidBatchWorth(batchAuction.Id, s.addr(4), parseDec("0.5"), parseCoin("100000000denom4"), sdk.NewInt(1000000000), true) - s.placeBidBatchWorth(batchAuction.Id, s.addr(4), parseDec("0.4"), parseCoin("150000000denom4"), sdk.NewInt(1000000000), true) - s.placeBidBatchWorth(batchAuction.Id, s.addr(5), parseDec("0.66"), parseCoin("250000000denom4"), sdk.NewInt(1000000000), true) - s.placeBidBatchMany(batchAuction.Id, s.addr(6), parseDec("0.8"), parseCoin("150000000denom3"), sdk.NewInt(1000000000), true) - s.placeBidBatchMany(batchAuction.Id, s.addr(7), parseDec("0.2"), parseCoin("150000000denom3"), sdk.NewInt(1000000000), true) - - // Modify the time to make the first and second vesting queues over - s.ctx = s.ctx.WithBlockTime(fixedAuction.VestingSchedules[1].ReleaseTime.AddDate(0, 0, 1)) - fundraising.BeginBlocker(s.ctx, s.keeper) - - queues := s.keeper.GetVestingQueuesByAuctionId(s.ctx, 1) - s.Require().Len(queues, 4) - - for i, queue := range queues { - if i == 0 || i == 1 { - s.Require().True(queue.Released) - } else { - s.Require().False(queue.Released) - } - } - - var genState *types.GenesisState - s.Require().NotPanics(func() { - genState = s.keeper.ExportGenesis(s.ctx) - }) - s.Require().NoError(genState.Validate()) - - s.Require().NotPanics(func() { - s.keeper.InitGenesis(s.ctx, *genState) - }) - s.Require().Equal(genState, s.keeper.ExportGenesis(s.ctx)) -} diff --git a/x/fundraising/keeper/grpc_query.go b/x/fundraising/keeper/grpc_query.go deleted file mode 100644 index 61938d5c..00000000 --- a/x/fundraising/keeper/grpc_query.go +++ /dev/null @@ -1,347 +0,0 @@ -package keeper - -import ( - "context" - "strconv" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - - "github.com/tendermint/fundraising/x/fundraising/types" -) - -// Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper. -type Querier struct { - Keeper -} - -var _ types.QueryServer = Querier{} - -// Params queries the parameters of the fundraising module. -func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - ctx := sdk.UnwrapSDKContext(c) - var params types.Params - k.Keeper.paramSpace.GetParamSet(ctx, ¶ms) - return &types.QueryParamsResponse{Params: params}, nil -} - -// Auctions queries all auctions. -func (k Querier) Auctions(c context.Context, req *types.QueryAuctionsRequest) (*types.QueryAuctionsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - - if req.Type != "" && !(req.Type == types.AuctionTypeFixedPrice.String() || req.Type == types.AuctionTypeBatch.String()) { - return nil, status.Errorf(codes.InvalidArgument, "invalid auction type %s", req.Type) - } - - if req.Status != "" && !(req.Status == types.AuctionStatusStandBy.String() || req.Status == types.AuctionStatusStarted.String() || - req.Status == types.AuctionStatusVesting.String() || req.Status == types.AuctionStatusFinished.String() || - req.Status == types.AuctionStatusCancelled.String()) { - return nil, status.Errorf(codes.InvalidArgument, "invalid auction status %s", req.Status) - } - - ctx := sdk.UnwrapSDKContext(c) - store := ctx.KVStore(k.storeKey) - auctionStore := prefix.NewStore(store, types.AuctionKeyPrefix) - - var auctions []*codectypes.Any - pageRes, err := query.FilteredPaginate(auctionStore, req.Pagination, func(key, value []byte, accumulate bool) (bool, error) { - auction, err := types.UnmarshalAuction(k.cdc, value) - if err != nil { - return false, err - } - - auctionAny, err := types.PackAuction(auction) - if err != nil { - return false, err - } - - if req.Type != "" && auction.GetType().String() != req.Type { - return false, nil - } - - if req.Status != "" && auction.GetStatus().String() != req.Status { - return false, nil - } - - if accumulate { - auctions = append(auctions, auctionAny) - } - - return true, nil - }) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAuctionsResponse{Auctions: auctions, Pagination: pageRes}, nil -} - -// Auction queries the specific auction. -func (k Querier) Auction(c context.Context, req *types.QueryAuctionRequest) (*types.QueryAuctionResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - - ctx := sdk.UnwrapSDKContext(c) - auction, found := k.Keeper.GetAuction(ctx, req.AuctionId) - if !found { - return nil, status.Errorf(codes.NotFound, "auction %d not found", req.AuctionId) - } - - auctionAny, err := types.PackAuction(auction) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAuctionResponse{Auction: auctionAny}, nil -} - -// AllowedBidder queries the specific allowed bidder information. -func (k Querier) AllowedBidder(c context.Context, req *types.QueryAllowedBidderRequest) (*types.QueryAllowedBidderResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - - if req.AuctionId == 0 { - return nil, status.Error(codes.InvalidArgument, "auction id cannot be 0") - } - - if req.Bidder == "" { - return nil, status.Error(codes.InvalidArgument, "empty bidder address") - } - - ctx := sdk.UnwrapSDKContext(c) - - _, found := k.GetAuction(ctx, req.AuctionId) - if !found { - return nil, status.Errorf(codes.NotFound, "auction %d not found", req.AuctionId) - } - - bidderAddr, err := sdk.AccAddressFromBech32(req.Bidder) - if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "bidder address %s is not valid", req.Bidder) - } - - allowedBidder, found := k.GetAllowedBidder(ctx, req.AuctionId, bidderAddr) - if !found { - return nil, status.Errorf(codes.NotFound, "allowed bidder by auction id %d and bidder address %s doesn't exist", req.AuctionId, req.Bidder) - } - - return &types.QueryAllowedBidderResponse{AllowedBidder: allowedBidder}, nil -} - -// AllowedBidders queries all allowed bidders for the auction. -func (k Querier) AllowedBidders(c context.Context, req *types.QueryAllowedBiddersRequest) (*types.QueryAllowedBiddersResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - - if req.AuctionId == 0 { - return nil, status.Error(codes.InvalidArgument, "auction id cannot be 0") - } - - ctx := sdk.UnwrapSDKContext(c) - - _, found := k.GetAuction(ctx, req.AuctionId) - if !found { - return nil, status.Errorf(codes.NotFound, "auction %d not found", req.AuctionId) - } - - store := ctx.KVStore(k.storeKey) - abStore := prefix.NewStore(store, types.GetAllowedBiddersByAuctionKeyPrefix(req.AuctionId)) - - var allowedBidders []types.AllowedBidder - pageRes, err := query.FilteredPaginate(abStore, req.Pagination, func(key, value []byte, accumulate bool) (bool, error) { - var allowedBidder types.AllowedBidder - err := k.cdc.Unmarshal(value, &allowedBidder) - if err != nil { - return false, nil - } - - if accumulate { - allowedBidders = append(allowedBidders, allowedBidder) - } - - return true, nil - }) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllowedBiddersResponse{AllowedBidders: allowedBidders, Pagination: pageRes}, nil -} - -// Bids queries all bids for the auction. -func (k Querier) Bids(c context.Context, req *types.QueryBidsRequest) (*types.QueryBidsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - - ctx := sdk.UnwrapSDKContext(c) - _, found := k.Keeper.GetAuction(ctx, req.AuctionId) - if !found { - return nil, status.Errorf(codes.NotFound, "auction %d not found", req.AuctionId) - } - - var bids []types.Bid - var pageRes *query.PageResponse - var err error - - store := ctx.KVStore(k.storeKey) - switch { - case req.Bidder != "" && req.IsMatched == "": - bids, pageRes, err = queryBidsByBidder(ctx, k, store, req) - case req.Bidder == "" && req.IsMatched != "": - bids, pageRes, err = queryBidsByIsMatched(ctx, k, store, req) - case req.Bidder != "" && req.IsMatched != "": - bids, pageRes, err = queryBidsByBidder(ctx, k, store, req) - default: - bids, pageRes, err = queryAllBids(ctx, k, store, req) - } - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryBidsResponse{Bids: bids, Pagination: pageRes}, nil -} - -// Bid queries the specific bid from the auction id and bid id. -func (k Querier) Bid(c context.Context, req *types.QueryBidRequest) (*types.QueryBidResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - - ctx := sdk.UnwrapSDKContext(c) - bid, found := k.Keeper.GetBid(ctx, req.AuctionId, req.BidId) - if !found { - return nil, status.Errorf(codes.NotFound, "bid from auction id %d and bid id %d not found", req.AuctionId, req.BidId) - } - - return &types.QueryBidResponse{Bid: bid}, nil -} - -// Vestings queries all vesting queues for the auction. -func (k Querier) Vestings(c context.Context, req *types.QueryVestingsRequest) (*types.QueryVestingsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - - ctx := sdk.UnwrapSDKContext(c) - auction, found := k.Keeper.GetAuction(ctx, req.AuctionId) - if !found { - return nil, status.Errorf(codes.NotFound, "auction %d not found", req.AuctionId) - } - - queues := k.Keeper.GetVestingQueuesByAuctionId(ctx, auction.GetId()) - - return &types.QueryVestingsResponse{Vestings: queues}, nil -} - -func queryAllBids(ctx sdk.Context, k Querier, store sdk.KVStore, req *types.QueryBidsRequest) (bids []types.Bid, pageRes *query.PageResponse, err error) { - bidStore := prefix.NewStore(store, types.BidKeyPrefix) - - pageRes, err = query.FilteredPaginate(bidStore, req.Pagination, func(key, value []byte, accumulate bool) (bool, error) { - var bid types.Bid - if err := k.cdc.Unmarshal(value, &bid); err != nil { - return false, nil - } - - if bid.AuctionId != req.AuctionId { - return false, nil - } - - if accumulate { - bids = append(bids, bid) - } - - return true, nil - }) - if err != nil { - return nil, nil, status.Error(codes.Internal, err.Error()) - } - - return bids, pageRes, err -} - -func queryBidsByBidder(ctx sdk.Context, k Querier, store sdk.KVStore, req *types.QueryBidsRequest) (bids []types.Bid, pageRes *query.PageResponse, err error) { - bidderAddr, err := sdk.AccAddressFromBech32(req.Bidder) - if err != nil { - return nil, nil, err - } - - bidStore := prefix.NewStore(store, types.GetBidIndexByBidderPrefix(bidderAddr)) - - pageRes, err = query.FilteredPaginate(bidStore, req.Pagination, func(key, value []byte, accumulate bool) (bool, error) { - auctionId, bidId := types.SplitAuctionIdBidIdKey(key) - bid, _ := k.GetBid(ctx, auctionId, bidId) - - if req.Bidder != bid.Bidder { - return false, nil - } - - if req.IsMatched != "" { - isMatched, err := strconv.ParseBool(req.IsMatched) - if err != nil { - return false, err - } - - if bid.IsMatched != isMatched { - return false, nil - } - } - - if accumulate { - bids = append(bids, bid) - } - - return true, nil - }) - - if err != nil { - return nil, nil, status.Error(codes.Internal, err.Error()) - } - - return bids, pageRes, err -} - -func queryBidsByIsMatched(ctx sdk.Context, k Querier, store sdk.KVStore, req *types.QueryBidsRequest) (bids []types.Bid, pageRes *query.PageResponse, err error) { - isMatched, err := strconv.ParseBool(req.IsMatched) - if err != nil { - return nil, nil, err - } - - bidStore := prefix.NewStore(store, types.BidKeyPrefix) - - pageRes, err = query.FilteredPaginate(bidStore, req.Pagination, func(key, value []byte, accumulate bool) (bool, error) { - var bid types.Bid - if err := k.cdc.Unmarshal(value, &bid); err != nil { - return false, nil - } - - if bid.AuctionId != req.AuctionId { - return false, nil - } - - if bid.IsMatched != isMatched { - return false, nil - } - - if accumulate { - bids = append(bids, bid) - } - - return true, nil - }) - if err != nil { - return nil, nil, status.Error(codes.Internal, err.Error()) - } - - return bids, pageRes, err -} diff --git a/x/fundraising/keeper/grpc_query_test.go b/x/fundraising/keeper/grpc_query_test.go deleted file mode 100644 index af4c614a..00000000 --- a/x/fundraising/keeper/grpc_query_test.go +++ /dev/null @@ -1,583 +0,0 @@ -package keeper_test - -import ( - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - - "github.com/tendermint/fundraising/x/fundraising" - "github.com/tendermint/fundraising/x/fundraising/types" - - _ "github.com/stretchr/testify/suite" -) - -func (s *KeeperTestSuite) TestGRPCParams() { - resp, err := s.querier.Params(sdk.WrapSDKContext(s.ctx), &types.QueryParamsRequest{}) - s.Require().NoError(err) - s.Require().Equal(s.keeper.GetParams(s.ctx), resp.Params) -} - -func (s *KeeperTestSuite) TestGRPCAuctions() { - s.createFixedPriceAuction( - s.addr(0), - parseDec("1"), - parseCoin("5000000000denom1"), - "denom2", - []types.VestingSchedule{}, - time.Now().AddDate(0, 6, 0), - time.Now().AddDate(0, 6, 0).AddDate(0, 1, 0), - true, - ) - - s.createFixedPriceAuction( - s.addr(1), - sdk.MustNewDecFromStr("0.5"), - parseCoin("1000000000000denom3"), - "denom4", - []types.VestingSchedule{}, - time.Now().AddDate(0, 0, -1), - time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), - true, - ) - - for _, tc := range []struct { - name string - req *types.QueryAuctionsRequest - expectErr bool - postRun func(*types.QueryAuctionsResponse) - }{ - { - "nil request", - nil, - true, - nil, - }, - { - "invalid type", - &types.QueryAuctionsRequest{ - Type: "invalid", - }, - true, - nil, - }, - { - "query all auctions", - &types.QueryAuctionsRequest{}, - false, - func(resp *types.QueryAuctionsResponse) { - s.Require().Len(resp.Auctions, 2) - }, - }, - { - "query all auctions by auction status", - &types.QueryAuctionsRequest{ - Status: types.AuctionStatusStandBy.String(), - }, - false, - func(resp *types.QueryAuctionsResponse) { - s.Require().Len(resp.Auctions, 1) - }, - }, - { - "query all auction by auction type", - &types.QueryAuctionsRequest{ - Type: types.AuctionTypeFixedPrice.String(), - }, - false, - func(resp *types.QueryAuctionsResponse) { - auctions, err := types.UnpackAuctions(resp.Auctions) - s.Require().NoError(err) - s.Require().Len(auctions, 2) - - for _, auction := range auctions { - s.Require().Equal(types.AuctionTypeFixedPrice, auction.GetType()) - } - }, - }, - } { - s.Run(tc.name, func() { - resp, err := s.querier.Auctions(sdk.WrapSDKContext(s.ctx), tc.req) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - tc.postRun(resp) - } - }) - } -} - -func (s *KeeperTestSuite) TestGRPCAuction() { - auction := s.createFixedPriceAuction( - s.addr(0), - sdk.MustNewDecFromStr("0.5"), - parseCoin("500000000000denom1"), - "denom2", - []types.VestingSchedule{}, - time.Now().AddDate(0, 6, 0), - time.Now().AddDate(0, 6, 0).AddDate(0, 1, 0), - true, - ) - - for _, tc := range []struct { - name string - req *types.QueryAuctionRequest - expectErr bool - postRun func(*types.QueryAuctionResponse) - }{ - { - "nil request", - nil, - true, - nil, - }, - { - "id not found", - &types.QueryAuctionRequest{ - AuctionId: 5, - }, - true, - nil, - }, - { - "query by id", - &types.QueryAuctionRequest{ - AuctionId: 1, - }, - false, - func(resp *types.QueryAuctionResponse) { - a, err := types.UnpackAuction(resp.Auction) - s.Require().NoError(err) - - s.Require().Equal(auction.GetId(), a.GetId()) - s.Require().Equal(auction.GetAuctioneer(), a.GetAuctioneer()) - s.Require().Equal(auction.GetType(), a.GetType()) - s.Require().Equal(auction.GetStartPrice(), a.GetStartPrice()) - s.Require().Equal(auction.GetStartTime().UTC(), a.GetStartTime()) - s.Require().Equal(auction.GetEndTimes()[0].UTC(), a.GetEndTimes()[0]) - }, - }, - } { - s.Run(tc.name, func() { - resp, err := s.querier.Auction(sdk.WrapSDKContext(s.ctx), tc.req) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - tc.postRun(resp) - } - }) - } -} - -func (s *KeeperTestSuite) TestGRPCAllowedBidder() { - auction := s.createFixedPriceAuction( - s.addr(0), - parseDec("1"), - parseCoin("500000000000denom1"), - "denom2", - []types.VestingSchedule{}, - time.Now().AddDate(0, 0, -1), - time.Now().AddDate(0, 0, -1).AddDate(0, 1, 0), - true, - ) - - bidder := s.addr(1) - maxBidAmt := parseInt("100_000_000") - s.addAllowedBidder(auction.Id, bidder, maxBidAmt) - - for _, tc := range []struct { - name string - req *types.QueryAllowedBidderRequest - expectErr bool - postRun func(*types.QueryAllowedBidderResponse) - }{ - { - "nil request", - nil, - true, - nil, - }, - { - "auction id cannot be 0", - &types.QueryAllowedBidderRequest{ - AuctionId: 0, - Bidder: s.addr(1).String(), - }, - true, - nil, - }, - { - "auction id not found", - &types.QueryAllowedBidderRequest{ - AuctionId: 5, - Bidder: s.addr(1).String(), - }, - true, - nil, - }, - { - "bidder cannot be empty address", - &types.QueryAllowedBidderRequest{ - AuctionId: 1, - Bidder: "", - }, - true, - nil, - }, - { - "bidder not found", - &types.QueryAllowedBidderRequest{ - AuctionId: 1, - Bidder: s.addr(10).String(), - }, - true, - nil, - }, - { - "query by auction id and bidder", - &types.QueryAllowedBidderRequest{ - AuctionId: 1, - Bidder: s.addr(1).String(), - }, - false, - func(resp *types.QueryAllowedBidderResponse) { - s.Require().Equal(bidder.String(), resp.AllowedBidder.Bidder) - s.Require().Equal(maxBidAmt, resp.AllowedBidder.MaxBidAmount) - }, - }, - } { - s.Run(tc.name, func() { - resp, err := s.querier.AllowedBidder(sdk.WrapSDKContext(s.ctx), tc.req) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - tc.postRun(resp) - } - }) - } - -} - -func (s *KeeperTestSuite) TestGRPCAllowedBidders() { - auction := s.createFixedPriceAuction( - s.addr(0), - parseDec("1"), - parseCoin("500000000000denom1"), - "denom2", - []types.VestingSchedule{}, - time.Now().AddDate(0, 0, -1), - time.Now().AddDate(0, 0, -1).AddDate(0, 1, 0), - true, - ) - - s.addAllowedBidder(auction.Id, s.addr(1), parseInt("100_000_000")) - s.addAllowedBidder(auction.Id, s.addr(2), parseInt("200_000_000")) - s.addAllowedBidder(auction.Id, s.addr(3), parseInt("300_000_000")) - s.addAllowedBidder(auction.Id, s.addr(4), parseInt("400_000_000")) - s.addAllowedBidder(auction.Id, s.addr(5), parseInt("500_000_000")) - - for _, tc := range []struct { - name string - req *types.QueryAllowedBiddersRequest - expectErr bool - postRun func(*types.QueryAllowedBiddersResponse) - }{ - { - "nil request", - nil, - true, - nil, - }, - { - "auction id cannot be 0", - &types.QueryAllowedBiddersRequest{ - AuctionId: 0, - Pagination: &query.PageRequest{}, - }, - true, - nil, - }, - { - "auction id not found", - &types.QueryAllowedBiddersRequest{ - AuctionId: 5, - Pagination: &query.PageRequest{}, - }, - true, - nil, - }, - { - "query by auction id", - &types.QueryAllowedBiddersRequest{ - AuctionId: 1, - }, - false, - func(resp *types.QueryAllowedBiddersResponse) { - s.Require().Len(resp.AllowedBidders, 5) - }, - }, - } { - s.Run(tc.name, func() { - resp, err := s.querier.AllowedBidders(sdk.WrapSDKContext(s.ctx), tc.req) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - tc.postRun(resp) - } - }) - } - -} - -func (s *KeeperTestSuite) TestGRPCBids() { - auction := s.createFixedPriceAuction( - s.addr(0), - parseDec("1"), - parseCoin("500000000000denom1"), - "denom2", - []types.VestingSchedule{}, - time.Now().AddDate(0, 0, -1), - time.Now().AddDate(0, 0, -1).AddDate(0, 1, 0), - true, - ) - - bid1 := s.placeBidFixedPrice(auction.Id, s.addr(1), parseDec("1"), parseCoin("20000000denom2"), true) - bid2 := s.placeBidFixedPrice(auction.Id, s.addr(1), parseDec("1"), parseCoin("20000000denom2"), true) - bid3 := s.placeBidFixedPrice(auction.Id, s.addr(2), parseDec("1"), parseCoin("15000000denom2"), true) - bid4 := s.placeBidFixedPrice(auction.Id, s.addr(3), parseDec("1"), parseCoin("35000000denom2"), true) - - // Make bid4 not eligible - bid4.SetMatched(false) - s.keeper.SetBid(s.ctx, bid4) - - for _, tc := range []struct { - name string - req *types.QueryBidsRequest - expectErr bool - postRun func(*types.QueryBidsResponse) - }{ - { - "nil request", - nil, - true, - nil, - }, - { - "query by id", - &types.QueryBidsRequest{ - AuctionId: 1, - }, - false, - func(resp *types.QueryBidsResponse) { - s.Require().Len(resp.Bids, 4) - s.Require().True(coinEq(bid1.Coin, resp.Bids[0].Coin)) - s.Require().True(coinEq(bid2.Coin, resp.Bids[1].Coin)) - s.Require().True(coinEq(bid3.Coin, resp.Bids[2].Coin)) - s.Require().True(coinEq(bid4.Coin, resp.Bids[3].Coin)) - }, - }, - { - "query by bidder address", - &types.QueryBidsRequest{ - AuctionId: 1, - Bidder: bid1.Bidder, - }, - false, - func(resp *types.QueryBidsResponse) { - s.Require().Len(resp.Bids, 2) - }, - }, - { - "query by isMatched", - &types.QueryBidsRequest{ - AuctionId: 1, - IsMatched: "true", - }, - false, - func(resp *types.QueryBidsResponse) { - s.Require().Len(resp.Bids, 3) - }, - }, - { - "query by isMatched", - &types.QueryBidsRequest{ - AuctionId: 1, - IsMatched: "false", - }, - false, - func(resp *types.QueryBidsResponse) { - s.Require().Len(resp.Bids, 1) - }, - }, - { - "query by both bidder address and isMatched #1", - &types.QueryBidsRequest{ - AuctionId: 1, - Bidder: bid3.Bidder, - IsMatched: "true", - }, - false, - func(resp *types.QueryBidsResponse) { - s.Require().Len(resp.Bids, 1) - }, - }, - { - "query by both bidder address and isMatched #2", - &types.QueryBidsRequest{ - AuctionId: 1, - Bidder: bid4.Bidder, - IsMatched: "true", - }, - false, - func(resp *types.QueryBidsResponse) { - s.Require().Len(resp.Bids, 0) - }, - }, - } { - s.Run(tc.name, func() { - resp, err := s.querier.Bids(sdk.WrapSDKContext(s.ctx), tc.req) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - tc.postRun(resp) - } - }) - } -} - -func (s *KeeperTestSuite) TestGRPCBid() { - auction := s.createFixedPriceAuction( - s.addr(0), - parseDec("1"), - parseCoin("500000000000denom1"), - "denom2", - []types.VestingSchedule{}, - time.Now().AddDate(0, 0, -1), - time.Now().AddDate(0, 0, -1).AddDate(0, 1, 0), - true, - ) - - s.addAllowedBidder(auction.Id, s.addr(1), bidSellingAmount(parseDec("1"), parseCoin("20000000denom2"))) - bid := s.placeBidFixedPrice(auction.GetId(), s.addr(1), parseDec("1"), parseCoin("20000000denom2"), true) - - for _, tc := range []struct { - name string - req *types.QueryBidRequest - expectErr bool - postRun func(*types.QueryBidResponse) - }{ - { - "nil request", - nil, - true, - nil, - }, - { - "id not found", - &types.QueryBidRequest{ - AuctionId: 5, - }, - true, - nil, - }, - { - "bid id not found", - &types.QueryBidRequest{ - AuctionId: 2, - BidId: 5, - }, - true, - nil, - }, - { - "query by id and bid id", - &types.QueryBidRequest{ - AuctionId: 1, - BidId: 1, - }, - false, - func(resp *types.QueryBidResponse) { - s.Require().Equal(bid.AuctionId, resp.Bid.AuctionId) - s.Require().Equal(bid.GetBidder(), resp.Bid.GetBidder()) - s.Require().Equal(bid.Id, resp.Bid.Id) - s.Require().Equal(bid.Coin, resp.Bid.Coin) - s.Require().Equal(bid.IsMatched, resp.Bid.IsMatched) - }, - }, - } { - s.Run(tc.name, func() { - resp, err := s.querier.Bid(sdk.WrapSDKContext(s.ctx), tc.req) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - tc.postRun(resp) - } - }) - } -} - -func (s *KeeperTestSuite) TestGRPCVestings() { - auction := s.createFixedPriceAuction( - s.addr(0), - parseDec("1"), - parseCoin("1000000000000denom1"), - "denom2", - []types.VestingSchedule{ - { - ReleaseTime: time.Now().AddDate(1, 0, 0), - Weight: sdk.MustNewDecFromStr("0.5"), - }, - { - ReleaseTime: time.Now().AddDate(1, 6, 0), - Weight: sdk.MustNewDecFromStr("0.5"), - }, - }, - time.Now().AddDate(0, -1, 0), - time.Now().AddDate(0, -1, 0).AddDate(0, 3, 0), - true, - ) - - // Set the current block time a day after so that it gets finished - s.ctx = s.ctx.WithBlockTime(auction.GetEndTimes()[0].AddDate(0, 0, 1)) - fundraising.BeginBlocker(s.ctx, s.keeper) - - for _, tc := range []struct { - name string - req *types.QueryVestingsRequest - expectErr bool - postRun func(*types.QueryVestingsResponse) - }{ - { - "nil request", - nil, - true, - nil, - }, - { - "query by id", - &types.QueryVestingsRequest{ - AuctionId: 1, - }, - false, - func(resp *types.QueryVestingsResponse) { - s.Require().Len(resp.Vestings, 2) - }, - }, - } { - s.Run(tc.name, func() { - resp, err := s.querier.Vestings(sdk.WrapSDKContext(s.ctx), tc.req) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - tc.postRun(resp) - } - }) - } -} diff --git a/x/fundraising/keeper/hooks.go b/x/fundraising/keeper/hooks.go index 28ccb37d..25e19d26 100644 --- a/x/fundraising/keeper/hooks.go +++ b/x/fundraising/keeper/hooks.go @@ -1,6 +1,7 @@ package keeper import ( + "context" "time" "cosmossdk.io/math" @@ -12,19 +13,28 @@ import ( // Implements FundraisingHooks interface var _ types.FundraisingHooks = Keeper{} +// SetHooks sets the fundraising hooks. +func (k *Keeper) SetHooks(fk types.FundraisingHooks) *Keeper { + if k.hooks != nil { + panic("cannot set fundraising hooks twice") + } + k.hooks = fk + return k +} + // BeforeFixedPriceAuctionCreated - call hook if registered func (k Keeper) BeforeFixedPriceAuctionCreated( - ctx sdk.Context, + ctx context.Context, auctioneer string, - startPrice sdk.Dec, + startPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []types.VestingSchedule, startTime time.Time, endTime time.Time, -) { +) error { if k.hooks != nil { - k.hooks.BeforeFixedPriceAuctionCreated( + if err := k.hooks.BeforeFixedPriceAuctionCreated( ctx, auctioneer, startPrice, @@ -33,24 +43,27 @@ func (k Keeper) BeforeFixedPriceAuctionCreated( vestingSchedules, startTime, endTime, - ) + ); err != nil { + return err + } } + return nil } // AfterFixedPriceAuctionCreated - call hook if registered func (k Keeper) AfterFixedPriceAuctionCreated( - ctx sdk.Context, + ctx context.Context, auctionId uint64, auctioneer string, - startPrice sdk.Dec, + startPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []types.VestingSchedule, startTime time.Time, endTime time.Time, -) { +) error { if k.hooks != nil { - k.hooks.AfterFixedPriceAuctionCreated( + if err := k.hooks.AfterFixedPriceAuctionCreated( ctx, auctionId, auctioneer, @@ -60,26 +73,29 @@ func (k Keeper) AfterFixedPriceAuctionCreated( vestingSchedules, startTime, endTime, - ) + ); err != nil { + return err + } } + return nil } // BeforeBatchAuctionCreated - call hook if registered func (k Keeper) BeforeBatchAuctionCreated( - ctx sdk.Context, + ctx context.Context, auctioneer string, - startPrice sdk.Dec, - minBidPrice sdk.Dec, + startPrice math.LegacyDec, + minBidPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []types.VestingSchedule, maxExtendedRound uint32, - extendedRoundRate sdk.Dec, + extendedRoundRate math.LegacyDec, startTime time.Time, endTime time.Time, -) { +) error { if k.hooks != nil { - k.hooks.BeforeBatchAuctionCreated( + if err := k.hooks.BeforeBatchAuctionCreated( ctx, auctioneer, startPrice, @@ -91,27 +107,30 @@ func (k Keeper) BeforeBatchAuctionCreated( extendedRoundRate, startTime, endTime, - ) + ); err != nil { + return err + } } + return nil } // AfterBatchAuctionCreated - call hook if registered func (k Keeper) AfterBatchAuctionCreated( - ctx sdk.Context, + ctx context.Context, auctionId uint64, auctioneer string, - startPrice sdk.Dec, - minBidPrice sdk.Dec, + startPrice math.LegacyDec, + minBidPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []types.VestingSchedule, maxExtendedRound uint32, - extendedRoundRate sdk.Dec, + extendedRoundRate math.LegacyDec, startTime time.Time, endTime time.Time, -) { +) error { if k.hooks != nil { - k.hooks.AfterBatchAuctionCreated( + if err := k.hooks.AfterBatchAuctionCreated( ctx, auctionId, auctioneer, @@ -124,81 +143,102 @@ func (k Keeper) AfterBatchAuctionCreated( extendedRoundRate, startTime, endTime, - ) + ); err != nil { + return err + } } + return nil } // BeforeAuctionCanceled - call hook if registered func (k Keeper) BeforeAuctionCanceled( - ctx sdk.Context, + ctx context.Context, auctionId uint64, auctioneer string, -) { +) error { if k.hooks != nil { - k.hooks.BeforeAuctionCanceled(ctx, auctionId, auctioneer) + if err := k.hooks.BeforeAuctionCanceled(ctx, auctionId, auctioneer); err != nil { + return err + } } + return nil } // BeforeBidPlaced - call hook if registered func (k Keeper) BeforeBidPlaced( - ctx sdk.Context, + ctx context.Context, auctionId uint64, bidId uint64, bidder string, bidType types.BidType, - price sdk.Dec, + price math.LegacyDec, coin sdk.Coin, -) { +) error { if k.hooks != nil { - k.hooks.BeforeBidPlaced(ctx, auctionId, bidId, bidder, bidType, price, coin) + if err := k.hooks.BeforeBidPlaced(ctx, auctionId, bidId, bidder, bidType, price, coin); err != nil { + return err + } } + return nil } // BeforeBidModified - call hook if registered func (k Keeper) BeforeBidModified( - ctx sdk.Context, + ctx context.Context, auctionId uint64, bidId uint64, bidder string, bidType types.BidType, - price sdk.Dec, + price math.LegacyDec, coin sdk.Coin, -) { +) error { if k.hooks != nil { - k.hooks.BeforeBidModified(ctx, auctionId, bidId, bidder, bidType, price, coin) + if err := k.hooks.BeforeBidModified(ctx, auctionId, bidId, bidder, bidType, price, coin); err != nil { + return err + } } + return nil } // BeforeAllowedBiddersAdded - call hook if registered func (k Keeper) BeforeAllowedBiddersAdded( - ctx sdk.Context, + ctx context.Context, allowedBidders []types.AllowedBidder, -) { +) error { if k.hooks != nil { - k.hooks.BeforeAllowedBiddersAdded(ctx, allowedBidders) + if err := k.hooks.BeforeAllowedBiddersAdded(ctx, allowedBidders); err != nil { + return err + } } + return nil } // BeforeAllowedBidderUpdated - call hook if registered func (k Keeper) BeforeAllowedBidderUpdated( - ctx sdk.Context, + ctx context.Context, auctionId uint64, bidder sdk.AccAddress, maxBidAmount math.Int, -) { +) error { if k.hooks != nil { - k.hooks.BeforeAllowedBidderUpdated(ctx, auctionId, bidder, maxBidAmount) + if err := k.hooks.BeforeAllowedBidderUpdated(ctx, auctionId, bidder, maxBidAmount); err != nil { + return err + } } + return nil } // BeforeSellingCoinsAllocated - call hook if registered func (k Keeper) BeforeSellingCoinsAllocated( - ctx sdk.Context, + ctx context.Context, auctionId uint64, allocationMap map[string]math.Int, refundMap map[string]math.Int, -) { +) error { if k.hooks != nil { - k.hooks.BeforeSellingCoinsAllocated(ctx, auctionId, allocationMap, refundMap) + if err := k.hooks.BeforeSellingCoinsAllocated(ctx, auctionId, allocationMap, refundMap); err != nil { + return err + } } + return nil } diff --git a/x/fundraising/keeper/hooks_test.go b/x/fundraising/keeper/hooks_test.go index 1b07d672..df81f29d 100644 --- a/x/fundraising/keeper/hooks_test.go +++ b/x/fundraising/keeper/hooks_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "context" "time" "cosmossdk.io/math" @@ -27,120 +28,130 @@ type MockFundraisingHooksReceiver struct { } func (h *MockFundraisingHooksReceiver) BeforeFixedPriceAuctionCreated( - ctx sdk.Context, + ctx context.Context, auctioneer string, - startPrice sdk.Dec, + startPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []types.VestingSchedule, startTime time.Time, endTime time.Time, -) { +) error { h.BeforeFixedPriceAuctionCreatedValid = true + return nil } func (h *MockFundraisingHooksReceiver) AfterFixedPriceAuctionCreated( - ctx sdk.Context, + ctx context.Context, auctionId uint64, auctioneer string, - startPrice sdk.Dec, + startPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []types.VestingSchedule, startTime time.Time, endTime time.Time, -) { +) error { h.AfterFixedPriceAuctionCreatedValid = true + return nil } func (h *MockFundraisingHooksReceiver) BeforeBatchAuctionCreated( - ctx sdk.Context, + ctx context.Context, auctioneer string, - startPrice sdk.Dec, - minBidPrice sdk.Dec, + startPrice math.LegacyDec, + minBidPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []types.VestingSchedule, maxExtendedRound uint32, - extendedRoundRate sdk.Dec, + extendedRoundRate math.LegacyDec, startTime time.Time, endTime time.Time, -) { +) error { h.BeforeBatchAuctionCreatedValid = true + return nil } func (h *MockFundraisingHooksReceiver) AfterBatchAuctionCreated( - ctx sdk.Context, + ctx context.Context, auctionId uint64, auctioneer string, - startPrice sdk.Dec, - minBidPrice sdk.Dec, + startPrice math.LegacyDec, + minBidPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []types.VestingSchedule, maxExtendedRound uint32, - extendedRoundRate sdk.Dec, + extendedRoundRate math.LegacyDec, startTime time.Time, endTime time.Time, -) { +) error { h.AfterBatchAuctionCreatedValid = true + return nil } func (h *MockFundraisingHooksReceiver) BeforeAuctionCanceled( - ctx sdk.Context, + ctx context.Context, auctionId uint64, auctioneer string, -) { +) error { h.BeforeAuctionCanceledValid = true + return nil } func (h *MockFundraisingHooksReceiver) BeforeBidPlaced( - ctx sdk.Context, + ctx context.Context, auctionId uint64, bidId uint64, bidder string, bidType types.BidType, - price sdk.Dec, + price math.LegacyDec, coin sdk.Coin, -) { +) error { h.BeforeBidPlacedValid = true + return nil } func (h *MockFundraisingHooksReceiver) BeforeBidModified( - ctx sdk.Context, + ctx context.Context, auctionId uint64, bidId uint64, bidder string, bidType types.BidType, - price sdk.Dec, + price math.LegacyDec, coin sdk.Coin, -) { +) error { h.BeforeBidModifiedValid = true + return nil } func (h *MockFundraisingHooksReceiver) BeforeAllowedBiddersAdded( - ctx sdk.Context, + ctx context.Context, allowedBidders []types.AllowedBidder, -) { +) error { h.BeforeAllowedBiddersAddedValid = true + return nil } func (h *MockFundraisingHooksReceiver) BeforeAllowedBidderUpdated( - ctx sdk.Context, + ctx context.Context, auctionId uint64, bidder sdk.AccAddress, maxBidAmount math.Int, -) { +) error { h.BeforeAllowedBidderUpdatedValid = true + return nil } func (h *MockFundraisingHooksReceiver) BeforeSellingCoinsAllocated( - ctx sdk.Context, + ctx context.Context, auctionId uint64, allocationMap map[string]math.Int, refundMap map[string]math.Int, -) { +) error { h.BeforeSellingCoinsAllocatedValid = true + return nil } func (s *KeeperTestSuite) TestHooks() { @@ -183,7 +194,7 @@ func (s *KeeperTestSuite) TestHooks() { "denom4", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, @@ -212,11 +223,11 @@ func (s *KeeperTestSuite) TestHooks() { s.Require().True(fundraisingHooksReceiver.BeforeAuctionCanceledValid) // Get already started batch auction - auction, found := s.keeper.GetAuction(s.ctx, batchAuction.Id) - s.Require().True(found) + auction, err := s.keeper.Auction.Get(s.ctx, batchAuction.Id) + s.Require().NoError(err) // Add allowed bidder - allowedBidders := []types.AllowedBidder{types.NewAllowedBidder(s.addr(3), parseInt("100_000_000_000"))} + allowedBidders := []types.AllowedBidder{types.NewAllowedBidder(auction.GetId(), s.addr(3), parseInt("100_000_000_000"))} s.Require().NoError(s.keeper.AddAllowedBidders(s.ctx, auction.GetId(), allowedBidders)) s.Require().True(fundraisingHooksReceiver.BeforeAllowedBiddersAddedValid) @@ -226,7 +237,7 @@ func (s *KeeperTestSuite) TestHooks() { s.Require().True(fundraisingHooksReceiver.BeforeAllowedBidderUpdatedValid) // Place a bid - bid := s.placeBidBatchWorth(auction.GetId(), s.addr(3), parseDec("0.55"), parseCoin("5_000_000denom4"), sdk.NewInt(10_000_000), true) + bid := s.placeBidBatchWorth(auction.GetId(), s.addr(3), parseDec("0.55"), parseCoin("5_000_000denom4"), math.NewInt(10_000_000), true) s.Require().True(fundraisingHooksReceiver.BeforeBidPlacedValid) // Modify the bid @@ -242,7 +253,8 @@ func (s *KeeperTestSuite) TestHooks() { s.Require().True(fundraisingHooksReceiver.BeforeBidModifiedValid) // Calculate fixed price allocation - mInfo := s.keeper.CalculateFixedPriceAllocation(s.ctx, auction) + mInfo, err := s.keeper.CalculateFixedPriceAllocation(s.ctx, auction) + s.Require().NoError(err) // Allocate the selling coin err = s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) diff --git a/x/fundraising/keeper/invariants.go b/x/fundraising/keeper/invariants.go index 52610948..e430b2cf 100644 --- a/x/fundraising/keeper/invariants.go +++ b/x/fundraising/keeper/invariants.go @@ -3,6 +3,7 @@ package keeper import ( "fmt" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/tendermint/fundraising/x/fundraising/types" @@ -42,7 +43,11 @@ func SellingPoolReserveAmountInvariant(k Keeper) sdk.Invariant { msg := "" count := 0 - for _, auction := range k.GetAuctions(ctx) { + auctions, err := k.Auctions(ctx) + if err != nil { + return "", false + } + for _, auction := range auctions { if auction.GetStatus() == types.AuctionStatusStarted { sellingReserveAddr := auction.GetSellingReserveAddress() sellingCoinDenom := auction.GetSellingCoin().Denom @@ -72,11 +77,19 @@ func PayingPoolReserveAmountInvariant(k Keeper) sdk.Invariant { msg := "" count := 0 - for _, auction := range k.GetAuctions(ctx) { - totalBidCoin := sdk.NewCoin(auction.GetPayingCoinDenom(), sdk.ZeroInt()) + auctions, err := k.Auctions(ctx) + if err != nil { + return "", false + } + for _, auction := range auctions { + totalBidCoin := sdk.NewCoin(auction.GetPayingCoinDenom(), math.ZeroInt()) + bids, err := k.GetBidsByAuctionId(ctx, auction.GetId()) + if err != nil { + return "", false + } if auction.GetStatus() == types.AuctionStatusStarted { - for _, bid := range k.GetBidsByAuctionId(ctx, auction.GetId()) { + for _, bid := range bids { bidAmt := bid.ConvertToPayingAmount(auction.GetPayingCoinDenom()) totalBidCoin = totalBidCoin.Add(sdk.NewCoin(auction.GetPayingCoinDenom(), bidAmt)) } @@ -107,11 +120,19 @@ func VestingPoolReserveAmountInvariant(k Keeper) sdk.Invariant { msg := "" count := 0 - for _, auction := range k.GetAuctions(ctx) { - totalPayingCoin := sdk.NewCoin(auction.GetPayingCoinDenom(), sdk.ZeroInt()) + auctions, err := k.Auctions(ctx) + if err != nil { + return "", false + } + for _, auction := range auctions { + totalPayingCoin := sdk.NewCoin(auction.GetPayingCoinDenom(), math.ZeroInt()) + vestingQueues, err := k.GetVestingQueuesByAuctionId(ctx, auction.GetId()) + if err != nil { + return "", false + } if auction.GetStatus() == types.AuctionStatusVesting { - for _, queue := range k.GetVestingQueuesByAuctionId(ctx, auction.GetId()) { + for _, queue := range vestingQueues { if !queue.Released { totalPayingCoin = totalPayingCoin.Add(queue.PayingCoin) } diff --git a/x/fundraising/keeper/invariants_test.go b/x/fundraising/keeper/invariants_test.go index 2050a48d..48551c66 100644 --- a/x/fundraising/keeper/invariants_test.go +++ b/x/fundraising/keeper/invariants_test.go @@ -3,23 +3,22 @@ package keeper_test import ( "time" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + _ "github.com/stretchr/testify/suite" - "github.com/tendermint/fundraising/x/fundraising" "github.com/tendermint/fundraising/x/fundraising/keeper" "github.com/tendermint/fundraising/x/fundraising/types" - - _ "github.com/stretchr/testify/suite" ) func (s *KeeperTestSuite) TestSellingPoolReserveAmountInvariant() { - logger := s.keeper.Logger(s.ctx) + logger := s.keeper.Logger() logger.Info("TestSellingPoolReserveAmountInvariant") // Create a fixed price auction that has started status auction := s.createFixedPriceAuction( s.addr(0), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), sdk.NewInt64Coin("denom1", 500_000_000_000), "denom2", []types.VestingSchedule{}, @@ -48,14 +47,14 @@ func (s *KeeperTestSuite) TestSellingPoolReserveAmountInvariant() { } func (s *KeeperTestSuite) TestPayingPoolReserveAmountInvariant() { - logger := s.keeper.Logger(s.ctx) + logger := s.keeper.Logger() logger.Info("TestPayingPoolReserveAmountInvariant") k, ctx := s.keeper, s.ctx auction := s.createFixedPriceAuction( s.addr(0), - sdk.OneDec(), + math.LegacyOneDec(), sdk.NewInt64Coin("denom3", 500_000_000_000), "denom4", []types.VestingSchedule{}, @@ -65,12 +64,12 @@ func (s *KeeperTestSuite) TestPayingPoolReserveAmountInvariant() { ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidFixedPrice(auction.GetId(), s.addr(1), sdk.OneDec(), parseCoin("20000000denom4"), true) - s.placeBidFixedPrice(auction.GetId(), s.addr(2), sdk.OneDec(), parseCoin("20000000denom4"), true) - s.placeBidFixedPrice(auction.GetId(), s.addr(2), sdk.OneDec(), parseCoin("15000000denom4"), true) - s.placeBidFixedPrice(auction.GetId(), s.addr(3), sdk.OneDec(), parseCoin("35000000denom4"), true) - s.placeBidFixedPrice(auction.GetId(), s.addr(4), sdk.OneDec(), parseCoin("15000000denom3"), true) - s.placeBidFixedPrice(auction.GetId(), s.addr(5), sdk.OneDec(), parseCoin("20000000denom3"), true) + s.placeBidFixedPrice(auction.GetId(), s.addr(1), math.LegacyOneDec(), parseCoin("20000000denom4"), true) + s.placeBidFixedPrice(auction.GetId(), s.addr(2), math.LegacyOneDec(), parseCoin("20000000denom4"), true) + s.placeBidFixedPrice(auction.GetId(), s.addr(2), math.LegacyOneDec(), parseCoin("15000000denom4"), true) + s.placeBidFixedPrice(auction.GetId(), s.addr(3), math.LegacyOneDec(), parseCoin("35000000denom4"), true) + s.placeBidFixedPrice(auction.GetId(), s.addr(4), math.LegacyOneDec(), parseCoin("15000000denom3"), true) + s.placeBidFixedPrice(auction.GetId(), s.addr(5), math.LegacyOneDec(), parseCoin("20000000denom3"), true) _, broken := keeper.PayingPoolReserveAmountInvariant(k)(ctx) s.Require().False(broken) @@ -91,32 +90,32 @@ func (s *KeeperTestSuite) TestPayingPoolReserveAmountInvariant() { } func (s *KeeperTestSuite) TestVestingPoolReserveAmountInvariant() { - logger := s.keeper.Logger(s.ctx) + logger := s.keeper.Logger() logger.Info("TestVestingPoolReserveAmountInvariant") k, ctx := s.keeper, s.ctx auction := s.createFixedPriceAuction( s.addr(0), - sdk.OneDec(), + math.LegacyOneDec(), sdk.NewInt64Coin("denom3", 500_000_000_000), "denom4", []types.VestingSchedule{ { ReleaseTime: time.Now().AddDate(1, 0, 0), - Weight: sdk.MustNewDecFromStr("0.25"), + Weight: math.LegacyMustNewDecFromStr("0.25"), }, { ReleaseTime: time.Now().AddDate(1, 3, 0), - Weight: sdk.MustNewDecFromStr("0.25"), + Weight: math.LegacyMustNewDecFromStr("0.25"), }, { ReleaseTime: time.Now().AddDate(1, 6, 0), - Weight: sdk.MustNewDecFromStr("0.25"), + Weight: math.LegacyMustNewDecFromStr("0.25"), }, { ReleaseTime: time.Now().AddDate(1, 9, 0), - Weight: sdk.MustNewDecFromStr("0.25"), + Weight: math.LegacyMustNewDecFromStr("0.25"), }, }, time.Now().AddDate(0, 0, -1), @@ -125,18 +124,18 @@ func (s *KeeperTestSuite) TestVestingPoolReserveAmountInvariant() { ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidFixedPrice(auction.GetId(), s.addr(1), sdk.OneDec(), parseCoin("20000000denom4"), true) - s.placeBidFixedPrice(auction.GetId(), s.addr(2), sdk.OneDec(), parseCoin("20000000denom4"), true) - s.placeBidFixedPrice(auction.GetId(), s.addr(2), sdk.OneDec(), parseCoin("15000000denom4"), true) - s.placeBidFixedPrice(auction.GetId(), s.addr(3), sdk.OneDec(), parseCoin("35000000denom4"), true) + s.placeBidFixedPrice(auction.GetId(), s.addr(1), math.LegacyOneDec(), parseCoin("20000000denom4"), true) + s.placeBidFixedPrice(auction.GetId(), s.addr(2), math.LegacyOneDec(), parseCoin("20000000denom4"), true) + s.placeBidFixedPrice(auction.GetId(), s.addr(2), math.LegacyOneDec(), parseCoin("15000000denom4"), true) + s.placeBidFixedPrice(auction.GetId(), s.addr(3), math.LegacyOneDec(), parseCoin("35000000denom4"), true) // Make the auction ended ctx = ctx.WithBlockTime(auction.GetEndTimes()[0].AddDate(0, 0, 1)) - fundraising.BeginBlocker(ctx, k) + s.Require().NoError(k.BeginBlocker(ctx)) // Make first and second vesting queues over ctx = ctx.WithBlockTime(auction.GetVestingSchedules()[0].GetReleaseTime().AddDate(0, 0, 1)) - fundraising.BeginBlocker(ctx, k) + s.Require().NoError(k.BeginBlocker(ctx)) _, broken := keeper.VestingPoolReserveAmountInvariant(k)(ctx) s.Require().False(broken) diff --git a/x/fundraising/keeper/keeper.go b/x/fundraising/keeper/keeper.go index 75783f24..ec02bed7 100644 --- a/x/fundraising/keeper/keeper.go +++ b/x/fundraising/keeper/keeper.go @@ -1,14 +1,17 @@ package keeper import ( + "context" "fmt" "strconv" + "time" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/collections" + "cosmossdk.io/core/address" + "cosmossdk.io/core/store" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/tendermint/fundraising/x/fundraising/types" ) @@ -31,78 +34,97 @@ func init() { } } -type Keeper struct { - cdc codec.BinaryCodec - storeKey storetypes.StoreKey - memKey storetypes.StoreKey - paramSpace paramtypes.Subspace - accountKeeper types.AccountKeeper - bankKeeper types.BankKeeper - distrKeeper types.DistrKeeper - hooks types.FundraisingHooks -} +type ( + Keeper struct { + cdc codec.BinaryCodec + addressCodec address.Codec + storeService store.KVStoreService + logger log.Logger + + // the address capable of executing a MsgUpdateParams message. + // Typically, this should be the x/gov module account. + authority string + + Schema collections.Schema + Params collections.Item[types.Params] + MatchedBidsLen collections.Map[uint64, int64] + AllowedBidder collections.Map[collections.Pair[uint64, sdk.AccAddress], types.AllowedBidder] + VestingQueue collections.Map[collections.Pair[uint64, time.Time], types.VestingQueue] + BidSeq collections.Map[uint64, uint64] + Bid collections.Map[collections.Pair[uint64, uint64], types.Bid] + AuctionSeq collections.Sequence + Auction collections.Map[uint64, types.AuctionI] + // this line is used by starport scaffolding # collection/type + + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper + distrKeeper types.DistrKeeper + + hooks types.FundraisingHooks + } +) func NewKeeper( cdc codec.BinaryCodec, - key storetypes.StoreKey, - memKey storetypes.StoreKey, - paramSpace paramtypes.Subspace, + addressCodec address.Codec, + storeService store.KVStoreService, + logger log.Logger, + authority string, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, distrKeeper types.DistrKeeper, ) Keeper { - // Ensure fundraising module account is set - if addr := accountKeeper.GetModuleAddress(types.ModuleName); addr == nil { - panic(fmt.Sprintf("%s module account has not been set", types.ModuleName)) - } - - // Set KeyTable if it has not already been set - if !paramSpace.HasKeyTable() { - paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable()) + if _, err := addressCodec.StringToBytes(authority); err != nil { + panic(fmt.Sprintf("invalid authority address %s: %s", authority, err)) } - return Keeper{ - cdc: cdc, - storeKey: key, - memKey: memKey, - paramSpace: paramSpace, - accountKeeper: accountKeeper, - bankKeeper: bankKeeper, - distrKeeper: distrKeeper, + sb := collections.NewSchemaBuilder(storeService) + + k := Keeper{ + cdc: cdc, + addressCodec: addressCodec, + storeService: storeService, + authority: authority, + logger: logger, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + distrKeeper: distrKeeper, + Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)), + MatchedBidsLen: collections.NewMap(sb, types.MatchedBidsLenKey, "matchedBidsLen", collections.Uint64Key, collections.Int64Value), + AllowedBidder: collections.NewMap(sb, types.AllowedBidderKey, "allowedBidder", collections.PairKeyCodec(collections.Uint64Key, sdk.LengthPrefixedAddressKey(sdk.AccAddressKey)), codec.CollValue[types.AllowedBidder](cdc)), + VestingQueue: collections.NewMap(sb, types.VestingQueueKey, "vestingQueue", collections.PairKeyCodec(collections.Uint64Key, sdk.TimeKey), codec.CollValue[types.VestingQueue](cdc)), + BidSeq: collections.NewMap(sb, types.BidCountKey, "bid_seq", collections.Uint64Key, collections.Uint64Value), + Bid: collections.NewMap(sb, types.BidKey, "bid", collections.PairKeyCodec(collections.Uint64Key, collections.Uint64Key), codec.CollValue[types.Bid](cdc)), + AuctionSeq: collections.NewSequence(sb, types.AuctionCountKey, "auction_seq"), + Auction: collections.NewMap(sb, types.AuctionKey, "auction", collections.Uint64Key, codec.CollInterfaceValue[types.AuctionI](cdc)), + // this line is used by starport scaffolding # collection/instantiate } -} -// SetHooks sets the fundraising hooks. -func (k *Keeper) SetHooks(fk types.FundraisingHooks) *Keeper { - if k.hooks != nil { - panic("cannot set fundraising hooks twice") + schema, err := sb.Build() + if err != nil { + panic(err) } - - k.hooks = fk + k.Schema = schema 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", types.ModuleName)) -} - -// GetParams returns the parameters for the fundraising module. -func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { - k.paramSpace.GetParamSet(ctx, ¶ms) - return params +// GetAuthority returns the module's authority. +func (k Keeper) GetAuthority() string { + return k.authority } -// SetParams sets the parameters for the fundraising module. -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { - k.paramSpace.SetParamSet(ctx, ¶ms) +// Logger returns a module-specific logger. +func (k Keeper) Logger() log.Logger { + return k.logger.With("module", fmt.Sprintf("x/%s", types.ModuleName)) } // PayCreationFee sends the auction creation fee to the fee collector account. -func (k Keeper) PayCreationFee(ctx sdk.Context, auctioneerAddr sdk.AccAddress) error { - params := k.GetParams(ctx) - +func (k Keeper) PayCreationFee(ctx context.Context, auctioneerAddr sdk.AccAddress) error { + params, err := k.Params.Get(ctx) + if err != nil { + return err + } if err := k.distrKeeper.FundCommunityPool(ctx, params.AuctionCreationFee, auctioneerAddr); err != nil { return err } @@ -110,8 +132,11 @@ func (k Keeper) PayCreationFee(ctx sdk.Context, auctioneerAddr sdk.AccAddress) e } // PayPlaceBidFee sends the fee when placing a bid for an auction to the fee collector account. -func (k Keeper) PayPlaceBidFee(ctx sdk.Context, bidderAddr sdk.AccAddress) error { - params := k.GetParams(ctx) +func (k Keeper) PayPlaceBidFee(ctx context.Context, bidderAddr sdk.AccAddress) error { + params, err := k.Params.Get(ctx) + if err != nil { + return err + } if err := k.distrKeeper.FundCommunityPool(ctx, params.PlaceBidFee, bidderAddr); err != nil { return err @@ -120,7 +145,7 @@ func (k Keeper) PayPlaceBidFee(ctx sdk.Context, bidderAddr sdk.AccAddress) error } // ReserveSellingCoin reserves the selling coin to the selling reserve account. -func (k Keeper) ReserveSellingCoin(ctx sdk.Context, auctionId uint64, auctioneerAddr sdk.AccAddress, sellingCoin sdk.Coin) error { +func (k Keeper) ReserveSellingCoin(ctx context.Context, auctionId uint64, auctioneerAddr sdk.AccAddress, sellingCoin sdk.Coin) error { if err := k.bankKeeper.SendCoins(ctx, auctioneerAddr, types.SellingReserveAddress(auctionId), sdk.NewCoins(sellingCoin)); err != nil { return err } @@ -128,7 +153,7 @@ func (k Keeper) ReserveSellingCoin(ctx sdk.Context, auctionId uint64, auctioneer } // ReservePayingCoin reserves paying coin to the paying reserve account. -func (k Keeper) ReservePayingCoin(ctx sdk.Context, auctionId uint64, bidderAddr sdk.AccAddress, payingCoin sdk.Coin) error { +func (k Keeper) ReservePayingCoin(ctx context.Context, auctionId uint64, bidderAddr sdk.AccAddress, payingCoin sdk.Coin) error { if err := k.bankKeeper.SendCoins(ctx, bidderAddr, types.PayingReserveAddress(auctionId), sdk.NewCoins(payingCoin)); err != nil { return err } diff --git a/x/fundraising/keeper/keeper_test.go b/x/fundraising/keeper/keeper_test.go index 6e884114..961947d3 100644 --- a/x/fundraising/keeper/keeper_test.go +++ b/x/fundraising/keeper/keeper_test.go @@ -1,32 +1,36 @@ package keeper_test import ( - "encoding/binary" + "errors" "fmt" "strings" "testing" "time" + "cosmossdk.io/collections" "cosmossdk.io/math" tmrand "github.com/cometbft/cometbft/libs/rand" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" "github.com/tendermint/fundraising/app" - "github.com/tendermint/fundraising/testutil/simapp" + testkeeper "github.com/tendermint/fundraising/testutil/keeper" + "github.com/tendermint/fundraising/testutil/sample" + "github.com/tendermint/fundraising/testutil/testutil/simapp" "github.com/tendermint/fundraising/x/fundraising/keeper" "github.com/tendermint/fundraising/x/fundraising/types" ) +const maxAddress = 100 + type KeeperTestSuite struct { suite.Suite app *app.App ctx sdk.Context keeper keeper.Keeper - querier keeper.Querier msgServer types.MsgServer + addresses []sdk.AccAddress } func TestKeeperTestSuite(t *testing.T) { @@ -34,12 +38,18 @@ func TestKeeperTestSuite(t *testing.T) { } func (s *KeeperTestSuite) SetupTest() { + for i := 0; i < maxAddress; i++ { + s.addresses = append(s.addresses, sample.AccAddress()) + } chainID := "chain-" + tmrand.NewRand().Str(6) - s.app = simapp.New(chainID, app.DefaultNodeHome) - s.ctx = s.app.BaseApp.NewContext(false, tmproto.Header{}) + + var err error + s.app, err = simapp.New(chainID) + s.Require().NoError(err) + + s.ctx = s.app.BaseApp.NewContext(false) s.ctx = s.ctx.WithBlockTime(time.Now()) // set to current time s.keeper = s.app.FundraisingKeeper - s.querier = keeper.Querier{Keeper: s.keeper} s.msgServer = keeper.NewMsgServerImpl(s.keeper) } @@ -49,7 +59,7 @@ func (s *KeeperTestSuite) SetupTest() { func (s *KeeperTestSuite) createFixedPriceAuction( auctioneer sdk.AccAddress, - startPrice sdk.Dec, + startPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []types.VestingSchedule, @@ -57,7 +67,9 @@ func (s *KeeperTestSuite) createFixedPriceAuction( endTime time.Time, fund bool, ) *types.FixedPriceAuction { - params := s.keeper.GetParams(s.ctx) + params, err := s.keeper.Params.Get(s.ctx) + s.Require().NoError(err) + if fund { s.fundAddr(auctioneer, params.AuctionCreationFee.Add(sellingCoin)) } @@ -78,18 +90,20 @@ func (s *KeeperTestSuite) createFixedPriceAuction( func (s *KeeperTestSuite) createBatchAuction( auctioneer sdk.AccAddress, - startPrice sdk.Dec, - minBidPrice sdk.Dec, + startPrice math.LegacyDec, + minBidPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []types.VestingSchedule, maxExtendedRound uint32, - extendedRoundRate sdk.Dec, + extendedRoundRate math.LegacyDec, startTime time.Time, endTime time.Time, fund bool, ) *types.BatchAuction { - params := s.keeper.GetParams(s.ctx) + params, err := s.keeper.Params.Get(s.ctx) + s.Require().NoError(err) + if fund { s.fundAddr(auctioneer, params.AuctionCreationFee.Add(sellingCoin)) } @@ -111,24 +125,27 @@ func (s *KeeperTestSuite) createBatchAuction( return auction.(*types.BatchAuction) } -func (s *KeeperTestSuite) addAllowedBidder(auctionId uint64, bidder sdk.AccAddress, maxBidAmt math.Int) { - allowedBidder, found := s.keeper.GetAllowedBidder(s.ctx, auctionId, bidder) - if found { +func (s *KeeperTestSuite) addAllowedBidder(auctionId uint64, bidder sdk.AccAddress, maxBidAmt math.Int) error { + allowedBidder, err := s.keeper.AllowedBidder.Get(s.ctx, collections.Join(auctionId, bidder)) + if err == nil { maxBidAmt = maxBidAmt.Add(allowedBidder.MaxBidAmount) } + if err != nil && !errors.Is(err, collections.ErrNotFound) { + return err + } - s.keeper.SetAllowedBidder(s.ctx, auctionId, types.NewAllowedBidder(bidder, maxBidAmt)) + return s.keeper.AllowedBidder.Set(s.ctx, collections.Join(auctionId, bidder), types.NewAllowedBidder(auctionId, bidder, maxBidAmt)) } func (s *KeeperTestSuite) placeBidFixedPrice( auctionId uint64, bidder sdk.AccAddress, - price sdk.Dec, + price math.LegacyDec, coin sdk.Coin, fund bool, ) types.Bid { - auction, found := s.keeper.GetAuction(s.ctx, auctionId) - s.Require().True(found) + auction, err := s.keeper.Auction.Get(s.ctx, auctionId) + s.Require().NoError(err) var fundAmt math.Int var fundCoin sdk.Coin @@ -136,9 +153,9 @@ func (s *KeeperTestSuite) placeBidFixedPrice( if coin.Denom == auction.GetPayingCoinDenom() { fundCoin = coin - maxBidAmt = sdk.NewDecFromInt(coin.Amount).QuoTruncate(price).TruncateInt() + maxBidAmt = math.LegacyNewDecFromInt(coin.Amount).QuoTruncate(price).TruncateInt() } else { - fundAmt = sdk.NewDecFromInt(coin.Amount).Mul(price).Ceil().TruncateInt() + fundAmt = math.LegacyNewDecFromInt(coin.Amount).Mul(price).Ceil().TruncateInt() fundCoin = sdk.NewCoin(auction.GetPayingCoinDenom(), fundAmt) maxBidAmt = coin.Amount } @@ -147,7 +164,8 @@ func (s *KeeperTestSuite) placeBidFixedPrice( s.fundAddr(bidder, sdk.NewCoins(fundCoin)) } - s.addAllowedBidder(auctionId, bidder, maxBidAmt) + err = s.addAllowedBidder(auctionId, bidder, maxBidAmt) + s.Require().NoError(err) b, err := s.keeper.PlaceBid(s.ctx, &types.MsgPlaceBid{ AuctionId: auctionId, @@ -164,7 +182,7 @@ func (s *KeeperTestSuite) placeBidFixedPrice( func (s *KeeperTestSuite) placeBidBatchWorth( auctionId uint64, bidder sdk.AccAddress, - price sdk.Dec, + price math.LegacyDec, coin sdk.Coin, maxBidAmt math.Int, fund bool, @@ -173,7 +191,8 @@ func (s *KeeperTestSuite) placeBidBatchWorth( s.fundAddr(bidder, sdk.NewCoins(coin)) } - s.addAllowedBidder(auctionId, bidder, maxBidAmt) + err := s.addAllowedBidder(auctionId, bidder, maxBidAmt) + s.Require().NoError(err) b, err := s.keeper.PlaceBid(s.ctx, &types.MsgPlaceBid{ AuctionId: auctionId, @@ -190,22 +209,23 @@ func (s *KeeperTestSuite) placeBidBatchWorth( func (s *KeeperTestSuite) placeBidBatchMany( auctionId uint64, bidder sdk.AccAddress, - price sdk.Dec, + price math.LegacyDec, coin sdk.Coin, maxBidAmt math.Int, fund bool, ) types.Bid { - auction, found := s.keeper.GetAuction(s.ctx, auctionId) - s.Require().True(found) + auction, err := s.keeper.Auction.Get(s.ctx, auctionId) + s.Require().NoError(err) if fund { - fundAmt := sdk.NewDecFromInt(coin.Amount).Mul(price).Ceil().TruncateInt() + fundAmt := math.LegacyNewDecFromInt(coin.Amount).Mul(price).Ceil().TruncateInt() fundCoin := sdk.NewCoin(auction.GetPayingCoinDenom(), fundAmt) s.fundAddr(bidder, sdk.NewCoins(fundCoin)) } - s.addAllowedBidder(auctionId, bidder, maxBidAmt) + err = s.addAllowedBidder(auctionId, bidder, maxBidAmt) + s.Require().NoError(err) b, err := s.keeper.PlaceBid(s.ctx, &types.MsgPlaceBid{ AuctionId: auctionId, @@ -219,18 +239,16 @@ func (s *KeeperTestSuite) placeBidBatchMany( return b } -// // Below are useful helpers to write test code easily. -// - -func (s *KeeperTestSuite) addr(addrNum int) sdk.AccAddress { - addr := make(sdk.AccAddress, 20) - binary.PutVarint(addr, int64(addrNum)) - return addr +func (s *KeeperTestSuite) addr(index int) sdk.AccAddress { + if index >= maxAddress { + panic(fmt.Sprintf("invalid address index %d", index)) + } + return s.addresses[index] } func (s *KeeperTestSuite) fundAddr(addr sdk.AccAddress, coins sdk.Coins) { - err := simapp.FundAccount(s.app.BankKeeper, s.ctx, addr, coins) + err := testkeeper.FundAccount(s.app.BankKeeper, s.ctx, addr, coins) s.Require().NoError(err) } @@ -251,11 +269,13 @@ func (s *KeeperTestSuite) sendCoins(fromAddr, toAddr sdk.AccAddress, coins sdk.C // it includes all bids sorted in descending order, allocation, refund, and matching info. // it is useful for debugging. func (s *KeeperTestSuite) fullString(auctionId uint64, mInfo keeper.MatchingInfo) string { - auction, found := s.keeper.GetAuction(s.ctx, auctionId) - s.Require().True(found) + auction, err := s.keeper.Auction.Get(s.ctx, auctionId) + s.Require().NoError(err) payingCoinDenom := auction.GetPayingCoinDenom() - bids := s.keeper.GetBidsByAuctionId(s.ctx, auctionId) + bids, err := s.keeper.GetBidsByAuctionId(s.ctx, auctionId) + s.Require().NoError(err) + bids = types.SortBids(bids) var b strings.Builder @@ -298,8 +318,8 @@ func (s *KeeperTestSuite) fullString(auctionId uint64, mInfo keeper.MatchingInfo } // bodSellingAmount exchanges to selling coin amount (PayingCoinAmount/Price). -func bidSellingAmount(price sdk.Dec, coin sdk.Coin) math.Int { - return sdk.NewDecFromInt(coin.Amount).QuoTruncate(price).TruncateInt() +func bidSellingAmount(price math.LegacyDec, coin sdk.Coin) math.Int { + return math.LegacyNewDecFromInt(coin.Amount).QuoTruncate(price).TruncateInt() } // parseCoin parses string and returns sdk.Coin. @@ -325,19 +345,19 @@ func parseCoins(s string) sdk.Coins { // parseInt parses string and returns math.Int. func parseInt(s string) math.Int { s = strings.ReplaceAll(s, "_", "") - amt, ok := sdk.NewIntFromString(s) + amt, ok := math.NewIntFromString(s) if !ok { panic("failed to convert string to math.Int") } return amt } -// parseDec parses string and returns sdk.Dec. -func parseDec(s string) sdk.Dec { - return sdk.MustNewDecFromStr(s) +// parseDec parses string and returns math.LegacyDec. +func parseDec(s string) math.LegacyDec { + return math.LegacyMustNewDecFromStr(s) } // coinEq is a convenient method to test expected and got values of sdk.Coin. func coinEq(exp, got sdk.Coin) (bool, string, string, string) { - return exp.IsEqual(got), "expected:\t%v\ngot:\t\t%v", exp.String(), got.String() + return exp.Equal(got), "expected:\t%v\ngot:\t\t%v", exp.String(), got.String() } diff --git a/x/fundraising/keeper/match.go b/x/fundraising/keeper/match.go index b9ca770b..7b80598c 100644 --- a/x/fundraising/keeper/match.go +++ b/x/fundraising/keeper/match.go @@ -1,10 +1,12 @@ package keeper import ( + "context" + "errors" "sort" + "cosmossdk.io/collections" "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/tendermint/fundraising/x/fundraising/types" ) @@ -12,22 +14,37 @@ import ( // MatchingInfo holds information about an auction matching information. type MatchingInfo struct { MatchedLen int64 // the length of matched bids - MatchedPrice sdk.Dec // the final matched price + MatchedPrice math.LegacyDec // the final matched price TotalMatchedAmount math.Int // the total sold amount AllocationMap map[string]math.Int // the map that holds allocate amount information for each bidder ReservedMatchedMap map[string]math.Int // the map that holds each bidder's matched amount out of their total reserved amount RefundMap map[string]math.Int // the map that holds refund amount information for each bidder } +func (k Keeper) GetLastMatchedBidsLen(ctx context.Context, auctionId uint64) (int64, error) { + matchedBidsLen, err := k.MatchedBidsLen.Get(ctx, auctionId) + if errors.Is(err, collections.ErrNotFound) { + return 0, nil + } + return matchedBidsLen, err +} + +func (k Keeper) SetMatchedBidsLen(ctx context.Context, auctionId uint64, matchedLen int64) error { + return k.MatchedBidsLen.Set(ctx, auctionId, matchedLen) +} + // CalculateFixedPriceAllocation loops through all bids for the auction and calculate matching information. -func (k Keeper) CalculateFixedPriceAllocation(ctx sdk.Context, auction types.AuctionI) MatchingInfo { +func (k Keeper) CalculateFixedPriceAllocation(ctx context.Context, auction types.AuctionI) (MatchingInfo, error) { mInfo := MatchingInfo{ MatchedPrice: auction.GetStartPrice(), - TotalMatchedAmount: sdk.ZeroInt(), + TotalMatchedAmount: math.ZeroInt(), AllocationMap: map[string]math.Int{}, } - bids := k.GetBidsByAuctionId(ctx, auction.GetId()) + bids, err := k.GetBidsByAuctionId(ctx, auction.GetId()) + if err != nil { + return mInfo, err + } // All bids for the auction are already matched in message level // Loop through all bids and calculate allocated amount @@ -37,32 +54,38 @@ func (k Keeper) CalculateFixedPriceAllocation(ctx sdk.Context, auction types.Auc allocatedAmt, ok := mInfo.AllocationMap[bid.Bidder] if !ok { - allocatedAmt = sdk.ZeroInt() + allocatedAmt = math.ZeroInt() } mInfo.AllocationMap[bid.Bidder] = allocatedAmt.Add(bidAmt) mInfo.TotalMatchedAmount = mInfo.TotalMatchedAmount.Add(bidAmt) mInfo.MatchedLen++ } - return mInfo + return mInfo, nil } -func (k Keeper) CalculateBatchAllocation(ctx sdk.Context, auction types.AuctionI) MatchingInfo { +func (k Keeper) CalculateBatchAllocation(ctx context.Context, auction types.AuctionI) (MatchingInfo, error) { mInfo := MatchingInfo{ AllocationMap: map[string]math.Int{}, ReservedMatchedMap: map[string]math.Int{}, RefundMap: map[string]math.Int{}, } - bids := k.GetBidsByAuctionId(ctx, auction.GetId()) + bids, err := k.GetBidsByAuctionId(ctx, auction.GetId()) + if err != nil { + return mInfo, err + } prices, bidsByPrice := types.BidsByPrice(bids) sellingAmt := auction.GetSellingCoin().Amount - allowedBidders := k.GetAllowedBiddersByAuction(ctx, auction.GetId()) + allowedBidders, err := k.GetAllowedBiddersByAuction(ctx, auction.GetId()) + if err != nil { + return mInfo, err + } matchRes := &types.MatchResult{ - MatchPrice: sdk.Dec{}, - MatchedAmount: sdk.ZeroInt(), + MatchPrice: math.LegacyDec{}, + MatchedAmount: math.ZeroInt(), MatchResultByBidder: map[string]*types.BidderMatchResult{}, } @@ -91,14 +114,14 @@ func (k Keeper) CalculateBatchAllocation(ctx sdk.Context, auction types.AuctionI for _, bid := range bids { bidderReservedAmt, ok := reservedAmtByBidder[bid.Bidder] if !ok { - bidderReservedAmt = sdk.ZeroInt() + bidderReservedAmt = math.ZeroInt() } reservedAmtByBidder[bid.Bidder] = bidderReservedAmt.Add(bid.ConvertToPayingAmount(auction.GetPayingCoinDenom())) } for bidder, reservedAmt := range reservedAmtByBidder { - mInfo.AllocationMap[bidder] = sdk.ZeroInt() - mInfo.ReservedMatchedMap[bidder] = sdk.ZeroInt() + mInfo.AllocationMap[bidder] = math.ZeroInt() + mInfo.ReservedMatchedMap[bidder] = math.ZeroInt() mInfo.RefundMap[bidder] = reservedAmt } @@ -110,9 +133,10 @@ func (k Keeper) CalculateBatchAllocation(ctx sdk.Context, auction types.AuctionI for _, bid := range matchRes.MatchedBids { bid.SetMatched(true) - k.SetBid(ctx, bid) + if err := k.Bid.Set(ctx, collections.Join(bid.AuctionId, bid.Id), bid); err != nil { + return mInfo, err + } } - k.SetMatchedBidsLen(ctx, auction.GetId(), mInfo.MatchedLen) - return mInfo + return mInfo, k.SetMatchedBidsLen(ctx, auction.GetId(), mInfo.MatchedLen) } diff --git a/x/fundraising/keeper/match_test.go b/x/fundraising/keeper/match_test.go index 991d1836..211afb72 100644 --- a/x/fundraising/keeper/match_test.go +++ b/x/fundraising/keeper/match_test.go @@ -4,11 +4,10 @@ import ( "fmt" "time" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" + _ "github.com/stretchr/testify/suite" "github.com/tendermint/fundraising/x/fundraising/types" - - _ "github.com/stretchr/testify/suite" ) func (s *KeeperTestSuite) TestExampleFullString() { @@ -23,15 +22,16 @@ func (s *KeeperTestSuite) TestExampleFullString() { true, ) - a, found := s.keeper.GetAuction(s.ctx, auction.GetId()) - s.Require().True(found) + a, err := s.keeper.Auction.Get(s.ctx, auction.GetId()) + s.Require().NoError(err) s.placeBidFixedPrice(a.GetId(), s.addr(1), a.GetStartPrice(), parseCoin("15_000_000denom2"), true) s.placeBidFixedPrice(a.GetId(), s.addr(2), a.GetStartPrice(), parseCoin("20_000_000denom2"), true) s.placeBidFixedPrice(a.GetId(), s.addr(4), a.GetStartPrice(), parseCoin("10_000_000denom1"), true) s.placeBidFixedPrice(a.GetId(), s.addr(6), a.GetStartPrice(), parseCoin("20_000_000denom1"), true) - mInfo := s.keeper.CalculateFixedPriceAllocation(s.ctx, a) + mInfo, err := s.keeper.CalculateFixedPriceAllocation(s.ctx, a) + s.Require().NoError(err) fmt.Println(s.fullString(a.GetId(), mInfo)) // Output: @@ -66,36 +66,37 @@ func (s *KeeperTestSuite) TestBatchAuction_Many() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("1"), parseCoin("500_000_000denom1"), sdk.NewInt(1_000_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(2), parseDec("0.9"), parseCoin("500_000_000denom1"), sdk.NewInt(1_000_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("0.8"), parseCoin("500_000_000denom1"), sdk.NewInt(1_000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("1"), parseCoin("500_000_000denom1"), math.NewInt(1_000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(2), parseDec("0.9"), parseCoin("500_000_000denom1"), math.NewInt(1_000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("0.8"), parseCoin("500_000_000denom1"), math.NewInt(1_000_000_000), true) - a, found := s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) + a, err := s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) - mInfo := s.keeper.CalculateBatchAllocation(s.ctx, a) + mInfo, err := s.keeper.CalculateBatchAllocation(s.ctx, a) + s.Require().NoError(err) s.Require().Equal(mInfo.MatchedLen, int64(2)) s.Require().Equal(mInfo.MatchedPrice, parseDec("0.9")) - s.Require().Equal(mInfo.TotalMatchedAmount, sdk.NewInt(1_000_000_000)) - s.Require().Equal(mInfo.AllocationMap[s.addr(1).String()], sdk.NewInt(500_000_000)) - s.Require().Equal(mInfo.AllocationMap[s.addr(2).String()], sdk.NewInt(500_000_000)) - s.Require().Equal(mInfo.AllocationMap[s.addr(3).String()], sdk.NewInt(0)) - s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(1).String()], sdk.NewInt(450_000_000)) - s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(2).String()], sdk.NewInt(450_000_000)) - s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(3).String()], sdk.NewInt(0)) - s.Require().Equal(mInfo.RefundMap[s.addr(1).String()], sdk.NewInt(50_000_000)) - s.Require().Equal(mInfo.RefundMap[s.addr(3).String()], sdk.NewInt(400_000_000)) - s.Require().True(mInfo.RefundMap[s.addr(2).String()].Equal(sdk.NewInt(0))) - - err := s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) + s.Require().Equal(mInfo.TotalMatchedAmount, math.NewInt(1_000_000_000)) + s.Require().Equal(mInfo.AllocationMap[s.addr(1).String()], math.NewInt(500_000_000)) + s.Require().Equal(mInfo.AllocationMap[s.addr(2).String()], math.NewInt(500_000_000)) + s.Require().Equal(mInfo.AllocationMap[s.addr(3).String()], math.NewInt(0)) + s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(1).String()], math.NewInt(450_000_000)) + s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(2).String()], math.NewInt(450_000_000)) + s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(3).String()], math.NewInt(0)) + s.Require().Equal(mInfo.RefundMap[s.addr(1).String()], math.NewInt(50_000_000)) + s.Require().Equal(mInfo.RefundMap[s.addr(3).String()], math.NewInt(400_000_000)) + s.Require().True(mInfo.RefundMap[s.addr(2).String()].Equal(math.NewInt(0))) + + err = s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) s.Require().NoError(err) sellingReserveAmt := s.getBalance(auction.GetSellingReserveAddress(), auction.SellingCoin.Denom).Amount @@ -107,12 +108,12 @@ func (s *KeeperTestSuite) TestBatchAuction_Many() { s.Require().True(s.getBalance(auction.GetSellingReserveAddress(), auction.SellingCoin.Denom).IsZero()) // The auctioneer must have sellingCoin.Amount - TotalMatchedAmount - s.Require().Equal(s.getBalance(s.addr(0), auction.GetSellingCoin().Denom).Amount, sdk.NewInt(0)) + s.Require().Equal(s.getBalance(s.addr(0), auction.GetSellingCoin().Denom).Amount, math.NewInt(0)) // The bidders must have the matched selling coin - s.Require().Equal(s.getBalance(s.addr(1), auction.GetSellingCoin().Denom).Amount, sdk.NewInt(500_000_000)) - s.Require().Equal(s.getBalance(s.addr(2), auction.GetSellingCoin().Denom).Amount, sdk.NewInt(500_000_000)) - s.Require().Equal(s.getBalance(s.addr(3), auction.GetSellingCoin().Denom).Amount, sdk.NewInt(0)) + s.Require().Equal(s.getBalance(s.addr(1), auction.GetSellingCoin().Denom).Amount, math.NewInt(500_000_000)) + s.Require().Equal(s.getBalance(s.addr(2), auction.GetSellingCoin().Denom).Amount, math.NewInt(500_000_000)) + s.Require().Equal(s.getBalance(s.addr(3), auction.GetSellingCoin().Denom).Amount, math.NewInt(0)) // s.Require().True(s.getBalance(s.addr(3), auction.GetSellingCoin().Denom).IsZero()) @@ -130,41 +131,42 @@ func (s *KeeperTestSuite) TestBatchAuction_Worth() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidBatchWorth(auction.Id, s.addr(1), parseDec("1"), parseCoin("500_000_000denom2"), sdk.NewInt(1500_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(2), parseDec("0.9"), parseCoin("500_000_000denom2"), sdk.NewInt(1500_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.8"), parseCoin("500_000_000denom2"), sdk.NewInt(1500_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(1), parseDec("1"), parseCoin("500_000_000denom2"), math.NewInt(1500_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(2), parseDec("0.9"), parseCoin("500_000_000denom2"), math.NewInt(1500_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.8"), parseCoin("500_000_000denom2"), math.NewInt(1500_000_000), true) - a, found := s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) + a, err := s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) - mInfo := s.keeper.CalculateBatchAllocation(s.ctx, a) + mInfo, err := s.keeper.CalculateBatchAllocation(s.ctx, a) + s.Require().NoError(err) // Checking s.Require().Equal(int64(2), mInfo.MatchedLen) s.Require().Equal(parseDec("0.9"), mInfo.MatchedPrice) matchingPrice := parseDec("0.9") - matchedAmt := sdk.NewDec(500_000_000).QuoTruncate(matchingPrice).TruncateInt() + matchedAmt := math.LegacyNewDec(500_000_000).QuoTruncate(matchingPrice).TruncateInt() s.Require().Equal(mInfo.TotalMatchedAmount, matchedAmt.Add(matchedAmt)) s.Require().Equal(mInfo.AllocationMap[s.addr(1).String()], matchedAmt) s.Require().Equal(mInfo.AllocationMap[s.addr(2).String()], matchedAmt) - s.Require().Equal(mInfo.AllocationMap[s.addr(3).String()], sdk.NewInt(0)) - s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(1).String()], sdk.NewInt(500_000_000)) - s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(2).String()], sdk.NewInt(500_000_000)) - s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(3).String()], sdk.NewInt(0)) + s.Require().Equal(mInfo.AllocationMap[s.addr(3).String()], math.NewInt(0)) + s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(1).String()], math.NewInt(500_000_000)) + s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(2).String()], math.NewInt(500_000_000)) + s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(3).String()], math.NewInt(0)) s.Require().True(mInfo.RefundMap[s.addr(1).String()].IsZero()) s.Require().True(mInfo.RefundMap[s.addr(2).String()].IsZero()) - s.Require().Equal(mInfo.RefundMap[s.addr(3).String()], sdk.NewInt(500_000_000)) + s.Require().Equal(mInfo.RefundMap[s.addr(3).String()], math.NewInt(500_000_000)) // Distribute selling coin - err := s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) + err = s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) s.Require().NoError(err) err = s.keeper.RefundRemainingSellingCoin(s.ctx, auction) @@ -198,42 +200,43 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("1"), parseCoin("500_000_000denom1"), sdk.NewInt(1500_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(2), parseDec("0.9"), parseCoin("500_000_000denom2"), sdk.NewInt(1500_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.8"), parseCoin("500_000_000denom2"), sdk.NewInt(1500_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("1"), parseCoin("500_000_000denom1"), math.NewInt(1500_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(2), parseDec("0.9"), parseCoin("500_000_000denom2"), math.NewInt(1500_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.8"), parseCoin("500_000_000denom2"), math.NewInt(1500_000_000), true) - a, found := s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) + a, err := s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) - mInfo := s.keeper.CalculateBatchAllocation(s.ctx, a) + mInfo, err := s.keeper.CalculateBatchAllocation(s.ctx, a) + s.Require().NoError(err) // Checking s.Require().Equal(mInfo.MatchedLen, int64(2)) s.Require().Equal(mInfo.MatchedPrice, parseDec("0.9")) matchingPrice := parseDec("0.9") - matchedAmt1 := sdk.NewInt(500_000_000) - matchedAmt2 := sdk.NewDec(500_000_000).QuoTruncate(matchingPrice).TruncateInt() + matchedAmt1 := math.NewInt(500_000_000) + matchedAmt2 := math.LegacyNewDec(500_000_000).QuoTruncate(matchingPrice).TruncateInt() - s.Require().Equal(mInfo.TotalMatchedAmount, sdk.NewInt(500_000_000).Add(matchedAmt2)) + s.Require().Equal(mInfo.TotalMatchedAmount, math.NewInt(500_000_000).Add(matchedAmt2)) s.Require().Equal(mInfo.AllocationMap[s.addr(1).String()], matchedAmt1) s.Require().Equal(mInfo.AllocationMap[s.addr(2).String()], matchedAmt2) - s.Require().Equal(mInfo.AllocationMap[s.addr(3).String()], sdk.NewInt(0)) - s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(1).String()], sdk.NewInt(450_000_000)) - s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(2).String()], sdk.NewInt(500_000_000)) - s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(3).String()], sdk.NewInt(0)) - s.Require().Equal(mInfo.RefundMap[s.addr(1).String()], sdk.NewInt(50_000_000)) - s.Require().Equal(mInfo.RefundMap[s.addr(3).String()], sdk.NewInt(500_000_000)) + s.Require().Equal(mInfo.AllocationMap[s.addr(3).String()], math.NewInt(0)) + s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(1).String()], math.NewInt(450_000_000)) + s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(2).String()], math.NewInt(500_000_000)) + s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(3).String()], math.NewInt(0)) + s.Require().Equal(mInfo.RefundMap[s.addr(1).String()], math.NewInt(50_000_000)) + s.Require().Equal(mInfo.RefundMap[s.addr(3).String()], math.NewInt(500_000_000)) s.Require().True(mInfo.RefundMap[s.addr(2).String()].IsZero()) // Distribute selling coin - err := s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) + err = s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) s.Require().NoError(err) err = s.keeper.RefundRemainingSellingCoin(s.ctx, auction) @@ -267,38 +270,39 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Many_Limited() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("1"), parseCoin("400_000_000denom1"), sdk.NewInt(400_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(2), parseDec("0.9"), parseCoin("400_000_000denom1"), sdk.NewInt(400_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("0.8"), parseCoin("400_000_000denom1"), sdk.NewInt(400_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("1"), parseCoin("400_000_000denom1"), math.NewInt(400_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(2), parseDec("0.9"), parseCoin("400_000_000denom1"), math.NewInt(400_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("0.8"), parseCoin("400_000_000denom1"), math.NewInt(400_000_000), true) - a, found := s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) + a, err := s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) - mInfo := s.keeper.CalculateBatchAllocation(s.ctx, a) + mInfo, err := s.keeper.CalculateBatchAllocation(s.ctx, a) + s.Require().NoError(err) // Checking s.Require().Equal(mInfo.MatchedLen, int64(2)) s.Require().Equal(mInfo.MatchedPrice, parseDec("0.9")) - s.Require().Equal(mInfo.TotalMatchedAmount, sdk.NewInt(800_000_000)) - s.Require().Equal(mInfo.AllocationMap[s.addr(1).String()], sdk.NewInt(400_000_000)) - s.Require().Equal(mInfo.AllocationMap[s.addr(2).String()], sdk.NewInt(400_000_000)) - s.Require().Equal(mInfo.AllocationMap[s.addr(3).String()], sdk.NewInt(0)) - s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(1).String()], sdk.NewInt(360_000_000)) - s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(2).String()], sdk.NewInt(360_000_000)) - s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(3).String()], sdk.NewInt(0)) - s.Require().Equal(mInfo.RefundMap[s.addr(1).String()], sdk.NewInt(40_000_000)) + s.Require().Equal(mInfo.TotalMatchedAmount, math.NewInt(800_000_000)) + s.Require().Equal(mInfo.AllocationMap[s.addr(1).String()], math.NewInt(400_000_000)) + s.Require().Equal(mInfo.AllocationMap[s.addr(2).String()], math.NewInt(400_000_000)) + s.Require().Equal(mInfo.AllocationMap[s.addr(3).String()], math.NewInt(0)) + s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(1).String()], math.NewInt(360_000_000)) + s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(2).String()], math.NewInt(360_000_000)) + s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(3).String()], math.NewInt(0)) + s.Require().Equal(mInfo.RefundMap[s.addr(1).String()], math.NewInt(40_000_000)) s.Require().True(mInfo.RefundMap[s.addr(2).String()].IsZero()) - s.Require().Equal(mInfo.RefundMap[s.addr(3).String()], sdk.NewInt(320_000_000)) + s.Require().Equal(mInfo.RefundMap[s.addr(3).String()], math.NewInt(320_000_000)) // Distribute selling coin - err := s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) + err = s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) s.Require().NoError(err) err = s.keeper.RefundRemainingSellingCoin(s.ctx, auction) @@ -308,11 +312,11 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Many_Limited() { s.Require().True(s.getBalance(auction.GetSellingReserveAddress(), auction.SellingCoin.Denom).IsZero()) // The auctioneer must have sellingCoin.Amount - TotalMatchedAmount - s.Require().Equal(s.getBalance(s.addr(0), auction.GetSellingCoin().Denom).Amount, sdk.NewInt(200_000_000)) + s.Require().Equal(s.getBalance(s.addr(0), auction.GetSellingCoin().Denom).Amount, math.NewInt(200_000_000)) // The bidders must have the matched selling coin - s.Require().Equal(s.getBalance(s.addr(1), auction.GetSellingCoin().Denom).Amount, sdk.NewInt(400_000_000)) - s.Require().Equal(s.getBalance(s.addr(2), auction.GetSellingCoin().Denom).Amount, sdk.NewInt(400_000_000)) + s.Require().Equal(s.getBalance(s.addr(1), auction.GetSellingCoin().Denom).Amount, math.NewInt(400_000_000)) + s.Require().Equal(s.getBalance(s.addr(2), auction.GetSellingCoin().Denom).Amount, math.NewInt(400_000_000)) s.Require().True(s.getBalance(s.addr(3), auction.GetSellingCoin().Denom).IsZero()) // Refund payingCoin @@ -329,38 +333,39 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Worth_Limited() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidBatchWorth(auction.Id, s.addr(1), parseDec("1"), parseCoin("400_000_000denom2"), sdk.NewInt(400_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(2), parseDec("0.9"), parseCoin("360_000_000denom2"), sdk.NewInt(400_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.8"), parseCoin("320_000_000denom2"), sdk.NewInt(400_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(1), parseDec("1"), parseCoin("400_000_000denom2"), math.NewInt(400_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(2), parseDec("0.9"), parseCoin("360_000_000denom2"), math.NewInt(400_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.8"), parseCoin("320_000_000denom2"), math.NewInt(400_000_000), true) - a, found := s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) + a, err := s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) - mInfo := s.keeper.CalculateBatchAllocation(s.ctx, a) + mInfo, err := s.keeper.CalculateBatchAllocation(s.ctx, a) + s.Require().NoError(err) // Checking s.Require().Equal(mInfo.MatchedLen, int64(3)) s.Require().Equal(mInfo.MatchedPrice, parseDec("0.8")) - s.Require().Equal(mInfo.TotalMatchedAmount, sdk.NewInt(1200_000_000)) - s.Require().Equal(mInfo.AllocationMap[s.addr(1).String()], sdk.NewInt(400_000_000)) - s.Require().Equal(mInfo.AllocationMap[s.addr(2).String()], sdk.NewInt(400_000_000)) - s.Require().Equal(mInfo.AllocationMap[s.addr(3).String()], sdk.NewInt(400_000_000)) - s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(1).String()], sdk.NewInt(320_000_000)) - s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(2).String()], sdk.NewInt(320_000_000)) - s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(3).String()], sdk.NewInt(320_000_000)) - s.Require().Equal(mInfo.RefundMap[s.addr(1).String()], sdk.NewInt(80_000_000)) - s.Require().Equal(mInfo.RefundMap[s.addr(2).String()], sdk.NewInt(40_000_000)) + s.Require().Equal(mInfo.TotalMatchedAmount, math.NewInt(1200_000_000)) + s.Require().Equal(mInfo.AllocationMap[s.addr(1).String()], math.NewInt(400_000_000)) + s.Require().Equal(mInfo.AllocationMap[s.addr(2).String()], math.NewInt(400_000_000)) + s.Require().Equal(mInfo.AllocationMap[s.addr(3).String()], math.NewInt(400_000_000)) + s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(1).String()], math.NewInt(320_000_000)) + s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(2).String()], math.NewInt(320_000_000)) + s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(3).String()], math.NewInt(320_000_000)) + s.Require().Equal(mInfo.RefundMap[s.addr(1).String()], math.NewInt(80_000_000)) + s.Require().Equal(mInfo.RefundMap[s.addr(2).String()], math.NewInt(40_000_000)) s.Require().True(mInfo.RefundMap[s.addr(3).String()].IsZero()) // Distribute selling coin - err := s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) + err = s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) s.Require().NoError(err) err = s.keeper.RefundRemainingSellingCoin(s.ctx, auction) @@ -370,12 +375,12 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Worth_Limited() { s.Require().True(s.getBalance(auction.GetSellingReserveAddress(), auction.SellingCoin.Denom).IsZero()) // The auctioneer must have sellingCoin.Amount - TotalMatchedAmount - s.Require().Equal(s.getBalance(s.addr(0), auction.GetSellingCoin().Denom).Amount, sdk.NewInt(300_000_000)) + s.Require().Equal(s.getBalance(s.addr(0), auction.GetSellingCoin().Denom).Amount, math.NewInt(300_000_000)) // The bidders must have the matched selling coin - s.Require().Equal(s.getBalance(s.addr(1), auction.GetSellingCoin().Denom).Amount, sdk.NewInt(400_000_000)) - s.Require().Equal(s.getBalance(s.addr(2), auction.GetSellingCoin().Denom).Amount, sdk.NewInt(400_000_000)) - s.Require().Equal(s.getBalance(s.addr(3), auction.GetSellingCoin().Denom).Amount, sdk.NewInt(400_000_000)) + s.Require().Equal(s.getBalance(s.addr(1), auction.GetSellingCoin().Denom).Amount, math.NewInt(400_000_000)) + s.Require().Equal(s.getBalance(s.addr(2), auction.GetSellingCoin().Denom).Amount, math.NewInt(400_000_000)) + s.Require().Equal(s.getBalance(s.addr(3), auction.GetSellingCoin().Denom).Amount, math.NewInt(400_000_000)) // Refund payingCoin err = s.keeper.RefundPayingCoin(s.ctx, auction, mInfo) @@ -391,38 +396,39 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed_Limited() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("1"), parseCoin("500_000_000denom1"), sdk.NewInt(600_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(2), parseDec("0.9"), parseCoin("500_000_000denom2"), sdk.NewInt(600_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.8"), parseCoin("450_000_000denom2"), sdk.NewInt(600_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("1"), parseCoin("500_000_000denom1"), math.NewInt(600_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(2), parseDec("0.9"), parseCoin("500_000_000denom2"), math.NewInt(600_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.8"), parseCoin("450_000_000denom2"), math.NewInt(600_000_000), true) - a, found := s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) + a, err := s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) - mInfo := s.keeper.CalculateBatchAllocation(s.ctx, a) + mInfo, err := s.keeper.CalculateBatchAllocation(s.ctx, a) + s.Require().NoError(err) // Checking s.Require().Equal(mInfo.MatchedLen, int64(3)) s.Require().Equal(mInfo.MatchedPrice, parseDec("0.8")) - s.Require().Equal(mInfo.TotalMatchedAmount, sdk.NewInt(1662_500_000)) - s.Require().Equal(mInfo.AllocationMap[s.addr(1).String()], sdk.NewInt(500_000_000)) - s.Require().Equal(mInfo.AllocationMap[s.addr(2).String()], sdk.NewInt(600_000_000)) - s.Require().Equal(mInfo.AllocationMap[s.addr(3).String()], sdk.NewInt(562_500_000)) - s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(1).String()], sdk.NewInt(400_000_000)) - s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(2).String()], sdk.NewInt(480_000_000)) - s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(3).String()], sdk.NewInt(450_000_000)) - s.Require().Equal(mInfo.RefundMap[s.addr(1).String()], sdk.NewInt(100_000_000)) - s.Require().Equal(mInfo.RefundMap[s.addr(2).String()], sdk.NewInt(20_000_000)) + s.Require().Equal(mInfo.TotalMatchedAmount, math.NewInt(1662_500_000)) + s.Require().Equal(mInfo.AllocationMap[s.addr(1).String()], math.NewInt(500_000_000)) + s.Require().Equal(mInfo.AllocationMap[s.addr(2).String()], math.NewInt(600_000_000)) + s.Require().Equal(mInfo.AllocationMap[s.addr(3).String()], math.NewInt(562_500_000)) + s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(1).String()], math.NewInt(400_000_000)) + s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(2).String()], math.NewInt(480_000_000)) + s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(3).String()], math.NewInt(450_000_000)) + s.Require().Equal(mInfo.RefundMap[s.addr(1).String()], math.NewInt(100_000_000)) + s.Require().Equal(mInfo.RefundMap[s.addr(2).String()], math.NewInt(20_000_000)) s.Require().True(mInfo.RefundMap[s.addr(3).String()].IsZero()) // Distribute selling coin - err := s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) + err = s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) s.Require().NoError(err) err = s.keeper.RefundRemainingSellingCoin(s.ctx, auction) @@ -434,13 +440,13 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed_Limited() { // The auctioneer must have sellingCoin.Amount - TotalMatchedAmount s.Require().True( s.getBalance(s.addr(0), auction.GetSellingCoin().Denom).Amount. - Equal(sdk.NewInt(37_500_000)), + Equal(math.NewInt(37_500_000)), ) // The bidders must have the matched selling coin - s.Require().Equal(s.getBalance(s.addr(1), auction.GetSellingCoin().Denom).Amount, sdk.NewInt(500_000_000)) - s.Require().Equal(s.getBalance(s.addr(2), auction.GetSellingCoin().Denom).Amount, sdk.NewInt(600_000_000)) - s.Require().Equal(s.getBalance(s.addr(3), auction.GetSellingCoin().Denom).Amount, sdk.NewInt(562_500_000)) + s.Require().Equal(s.getBalance(s.addr(1), auction.GetSellingCoin().Denom).Amount, math.NewInt(500_000_000)) + s.Require().Equal(s.getBalance(s.addr(2), auction.GetSellingCoin().Denom).Amount, math.NewInt(600_000_000)) + s.Require().Equal(s.getBalance(s.addr(3), auction.GetSellingCoin().Denom).Amount, math.NewInt(562_500_000)) // Refund payingCoin err = s.keeper.RefundPayingCoin(s.ctx, auction, mInfo) @@ -456,47 +462,48 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed2() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("1"), parseCoin("200_000_000denom1"), sdk.NewInt(5000_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(2), parseDec("0.8"), parseCoin("500_000_000denom2"), sdk.NewInt(5000_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("0.9"), parseCoin("500_000_000denom1"), sdk.NewInt(5000_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(1), parseDec("1.1"), parseCoin("300_000_000denom2"), sdk.NewInt(0), true) - s.placeBidBatchMany(auction.Id, s.addr(5), parseDec("1.2"), parseCoin("300_000_000denom1"), sdk.NewInt(5000_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(4), parseDec("0.8"), parseCoin("100_000_000denom1"), sdk.NewInt(5000_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(2), parseDec("0.7"), parseCoin("100_000_000denom1"), sdk.NewInt(0), true) - s.placeBidBatchMany(auction.Id, s.addr(6), parseDec("0.5"), parseCoin("100_000_000denom1"), sdk.NewInt(5000_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.8"), parseCoin("300_000_000denom2"), sdk.NewInt(0), true) - s.placeBidBatchWorth(auction.Id, s.addr(7), parseDec("0.6"), parseCoin("500_000_000denom2"), sdk.NewInt(5000_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(8), parseDec("0.8"), parseCoin("500_000_000denom1"), sdk.NewInt(5000_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(9), parseDec("0.6"), parseCoin("600_000_000denom1"), sdk.NewInt(5000_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(6), parseDec("0.5"), parseCoin("500_000_000denom2"), sdk.NewInt(0), true) - s.placeBidBatchMany(auction.Id, s.addr(10), parseDec("0.6"), parseCoin("100_000_000denom1"), sdk.NewInt(5000_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.7"), parseCoin("800_000_000denom2"), sdk.NewInt(0), true) - - a, found := s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) - - mInfo := s.keeper.CalculateBatchAllocation(s.ctx, a) + s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("1"), parseCoin("200_000_000denom1"), math.NewInt(5000_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(2), parseDec("0.8"), parseCoin("500_000_000denom2"), math.NewInt(5000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("0.9"), parseCoin("500_000_000denom1"), math.NewInt(5000_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(1), parseDec("1.1"), parseCoin("300_000_000denom2"), math.NewInt(0), true) + s.placeBidBatchMany(auction.Id, s.addr(5), parseDec("1.2"), parseCoin("300_000_000denom1"), math.NewInt(5000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(4), parseDec("0.8"), parseCoin("100_000_000denom1"), math.NewInt(5000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(2), parseDec("0.7"), parseCoin("100_000_000denom1"), math.NewInt(0), true) + s.placeBidBatchMany(auction.Id, s.addr(6), parseDec("0.5"), parseCoin("100_000_000denom1"), math.NewInt(5000_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.8"), parseCoin("300_000_000denom2"), math.NewInt(0), true) + s.placeBidBatchWorth(auction.Id, s.addr(7), parseDec("0.6"), parseCoin("500_000_000denom2"), math.NewInt(5000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(8), parseDec("0.8"), parseCoin("500_000_000denom1"), math.NewInt(5000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(9), parseDec("0.6"), parseCoin("600_000_000denom1"), math.NewInt(5000_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(6), parseDec("0.5"), parseCoin("500_000_000denom2"), math.NewInt(0), true) + s.placeBidBatchMany(auction.Id, s.addr(10), parseDec("0.6"), parseCoin("100_000_000denom1"), math.NewInt(5000_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.7"), parseCoin("800_000_000denom2"), math.NewInt(0), true) + + a, err := s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) + + mInfo, err := s.keeper.CalculateBatchAllocation(s.ctx, a) + s.Require().NoError(err) // Checking s.Require().Equal(mInfo.MatchedLen, int64(10)) matchingPrice := parseDec("0.7") s.Require().Equal(mInfo.MatchedPrice, matchingPrice) - matchedAmt1 := sdk.NewDec(300_000_000).QuoTruncate(matchingPrice).TruncateInt().Add(sdk.NewInt(200_000_000)) - matchedAmt2 := sdk.NewDec(500_000_000).QuoTruncate(matchingPrice).TruncateInt().Add(sdk.NewInt(100_000_000)) - tMatchedAmt3 := sdk.NewDec(300_000_000).QuoTruncate(matchingPrice).TruncateInt().Add(sdk.NewInt(500_000_000)) - matchedAmt3 := tMatchedAmt3.Add(sdk.NewDec(800_000_000).QuoTruncate(matchingPrice).TruncateInt()) - matchedAmt4 := sdk.NewInt(100_000_000) - matchedAmt5 := sdk.NewInt(300_000_000) - matchedAmt8 := sdk.NewInt(500_000_000) - matchedAmt_Zero := sdk.NewInt(0) + matchedAmt1 := math.LegacyNewDec(300_000_000).QuoTruncate(matchingPrice).TruncateInt().Add(math.NewInt(200_000_000)) + matchedAmt2 := math.LegacyNewDec(500_000_000).QuoTruncate(matchingPrice).TruncateInt().Add(math.NewInt(100_000_000)) + tMatchedAmt3 := math.LegacyNewDec(300_000_000).QuoTruncate(matchingPrice).TruncateInt().Add(math.NewInt(500_000_000)) + matchedAmt3 := tMatchedAmt3.Add(math.LegacyNewDec(800_000_000).QuoTruncate(matchingPrice).TruncateInt()) + matchedAmt4 := math.NewInt(100_000_000) + matchedAmt5 := math.NewInt(300_000_000) + matchedAmt8 := math.NewInt(500_000_000) + matchedAmt_Zero := math.NewInt(0) totalMatchedAmt := matchedAmt1.Add(matchedAmt2).Add(matchedAmt3).Add(matchedAmt4).Add(matchedAmt5).Add(matchedAmt8) s.Require().Equal(mInfo.TotalMatchedAmount, totalMatchedAmt) @@ -511,13 +518,13 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed2() { s.Require().Equal(mInfo.AllocationMap[s.addr(9).String()], matchedAmt_Zero) s.Require().Equal(mInfo.AllocationMap[s.addr(10).String()], matchedAmt_Zero) - reservedmatchedAmt1 := sdk.NewDec(200_000_000).Mul(matchingPrice).Ceil().TruncateInt().Add(sdk.NewInt(300_000_000)) - reservedMatchedAmt2 := sdk.NewDec(100_000_000).Mul(matchingPrice).Ceil().TruncateInt().Add(sdk.NewInt(500_000_000)) - reservedMatchedAmt3 := sdk.NewDec(500_000_000).Mul(matchingPrice).Ceil().TruncateInt().Add(sdk.NewInt(1100_000_000)) - reservedMatchedAmt4 := sdk.NewDec(100_000_000).Mul(matchingPrice).Ceil().TruncateInt() - reservedMatchedAmt5 := sdk.NewDec(300_000_000).Mul(matchingPrice).Ceil().TruncateInt() - reservedMatchedAmt8 := sdk.NewDec(500_000_000).Mul(matchingPrice).Ceil().TruncateInt() - reservedMatchedAmt_Zero := sdk.NewInt(0) + reservedmatchedAmt1 := math.LegacyNewDec(200_000_000).Mul(matchingPrice).Ceil().TruncateInt().Add(math.NewInt(300_000_000)) + reservedMatchedAmt2 := math.LegacyNewDec(100_000_000).Mul(matchingPrice).Ceil().TruncateInt().Add(math.NewInt(500_000_000)) + reservedMatchedAmt3 := math.LegacyNewDec(500_000_000).Mul(matchingPrice).Ceil().TruncateInt().Add(math.NewInt(1100_000_000)) + reservedMatchedAmt4 := math.LegacyNewDec(100_000_000).Mul(matchingPrice).Ceil().TruncateInt() + reservedMatchedAmt5 := math.LegacyNewDec(300_000_000).Mul(matchingPrice).Ceil().TruncateInt() + reservedMatchedAmt8 := math.LegacyNewDec(500_000_000).Mul(matchingPrice).Ceil().TruncateInt() + reservedMatchedAmt_Zero := math.NewInt(0) s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(1).String()], reservedmatchedAmt1) s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(2).String()], reservedMatchedAmt2) @@ -530,16 +537,16 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed2() { s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(9).String()], reservedMatchedAmt_Zero) s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(10).String()], reservedMatchedAmt_Zero) - refundAmt1 := sdk.NewInt(60_000_000) - refundAmt2 := sdk.NewInt(0) - refundAmt3 := sdk.NewInt(100_000_000) - refundAmt4 := sdk.NewInt(10_000_000) - refundAmt5 := sdk.NewInt(150_000_000) - refundAmt6 := sdk.NewInt(550_000_000) - refundAmt7 := sdk.NewInt(500_000_000) - refundAmt8 := sdk.NewInt(50_000_000) - refundAmt9 := sdk.NewInt(360_000_000) - refundAmt10 := sdk.NewInt(60_000_000) + refundAmt1 := math.NewInt(60_000_000) + refundAmt2 := math.NewInt(0) + refundAmt3 := math.NewInt(100_000_000) + refundAmt4 := math.NewInt(10_000_000) + refundAmt5 := math.NewInt(150_000_000) + refundAmt6 := math.NewInt(550_000_000) + refundAmt7 := math.NewInt(500_000_000) + refundAmt8 := math.NewInt(50_000_000) + refundAmt9 := math.NewInt(360_000_000) + refundAmt10 := math.NewInt(60_000_000) s.Require().True(mInfo.RefundMap[s.addr(1).String()].Equal(refundAmt1)) s.Require().True(mInfo.RefundMap[s.addr(2).String()].Equal(refundAmt2)) @@ -553,7 +560,7 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed2() { s.Require().True(mInfo.RefundMap[s.addr(10).String()].Equal(refundAmt10)) // Distribute selling coin - err := s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) + err = s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) s.Require().NoError(err) err = s.keeper.RefundRemainingSellingCoin(s.ctx, auction) @@ -591,51 +598,52 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed2_LimitedSame() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("1"), parseCoin("200_000_000denom1"), sdk.NewInt(700_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(2), parseDec("0.8"), parseCoin("500_000_000denom2"), sdk.NewInt(700_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("0.9"), parseCoin("500_000_000denom1"), sdk.NewInt(700_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(1), parseDec("1.1"), parseCoin("300_000_000denom2"), sdk.NewInt(0), true) - s.placeBidBatchMany(auction.Id, s.addr(5), parseDec("1.2"), parseCoin("300_000_000denom1"), sdk.NewInt(700_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(4), parseDec("0.8"), parseCoin("100_000_000denom1"), sdk.NewInt(700_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(2), parseDec("0.7"), parseCoin("100_000_000denom1"), sdk.NewInt(0), true) - s.placeBidBatchMany(auction.Id, s.addr(6), parseDec("0.5"), parseCoin("100_000_000denom1"), sdk.NewInt(700_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.8"), parseCoin("300_000_000denom2"), sdk.NewInt(0), true) - s.placeBidBatchWorth(auction.Id, s.addr(7), parseDec("0.6"), parseCoin("400_000_000denom2"), sdk.NewInt(700_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(8), parseDec("0.8"), parseCoin("500_000_000denom1"), sdk.NewInt(700_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(9), parseDec("0.6"), parseCoin("600_000_000denom1"), sdk.NewInt(700_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(6), parseDec("0.5"), parseCoin("350_000_000denom2"), sdk.NewInt(0), true) - s.placeBidBatchMany(auction.Id, s.addr(10), parseDec("0.6"), parseCoin("100_000_000denom1"), sdk.NewInt(700_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.7"), parseCoin("490_000_000denom2"), sdk.NewInt(0), true) - - a, found := s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) - - mInfo := s.keeper.CalculateBatchAllocation(s.ctx, a) + s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("1"), parseCoin("200_000_000denom1"), math.NewInt(700_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(2), parseDec("0.8"), parseCoin("500_000_000denom2"), math.NewInt(700_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("0.9"), parseCoin("500_000_000denom1"), math.NewInt(700_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(1), parseDec("1.1"), parseCoin("300_000_000denom2"), math.NewInt(0), true) + s.placeBidBatchMany(auction.Id, s.addr(5), parseDec("1.2"), parseCoin("300_000_000denom1"), math.NewInt(700_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(4), parseDec("0.8"), parseCoin("100_000_000denom1"), math.NewInt(700_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(2), parseDec("0.7"), parseCoin("100_000_000denom1"), math.NewInt(0), true) + s.placeBidBatchMany(auction.Id, s.addr(6), parseDec("0.5"), parseCoin("100_000_000denom1"), math.NewInt(700_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.8"), parseCoin("300_000_000denom2"), math.NewInt(0), true) + s.placeBidBatchWorth(auction.Id, s.addr(7), parseDec("0.6"), parseCoin("400_000_000denom2"), math.NewInt(700_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(8), parseDec("0.8"), parseCoin("500_000_000denom1"), math.NewInt(700_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(9), parseDec("0.6"), parseCoin("600_000_000denom1"), math.NewInt(700_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(6), parseDec("0.5"), parseCoin("350_000_000denom2"), math.NewInt(0), true) + s.placeBidBatchMany(auction.Id, s.addr(10), parseDec("0.6"), parseCoin("100_000_000denom1"), math.NewInt(700_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.7"), parseCoin("490_000_000denom2"), math.NewInt(0), true) + + a, err := s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) + + mInfo, err := s.keeper.CalculateBatchAllocation(s.ctx, a) + s.Require().NoError(err) // Checking s.Require().Equal(int64(11), mInfo.MatchedLen) matchingPrice := parseDec("0.6") s.Require().Equal(mInfo.MatchedPrice, matchingPrice) - matchedAmt1 := sdk.NewInt(700_000_000) - matchedAmt2 := sdk.NewInt(700_000_000) - matchedAmt3 := sdk.NewInt(700_000_000) - matchedAmt4 := sdk.NewInt(100_000_000) - matchedAmt5 := sdk.NewInt(300_000_000) - matchedAmt6 := sdk.NewInt(0) - matchedAmt7 := sdk.NewDec(400_000_000).QuoTruncate(matchingPrice).TruncateInt() - matchedAmt8 := sdk.NewInt(500_000_000) - matchedAmt9 := sdk.NewInt(600_000_000) - matchedAmt10 := sdk.NewInt(100_000_000) + matchedAmt1 := math.NewInt(700_000_000) + matchedAmt2 := math.NewInt(700_000_000) + matchedAmt3 := math.NewInt(700_000_000) + matchedAmt4 := math.NewInt(100_000_000) + matchedAmt5 := math.NewInt(300_000_000) + matchedAmt6 := math.NewInt(0) + matchedAmt7 := math.LegacyNewDec(400_000_000).QuoTruncate(matchingPrice).TruncateInt() + matchedAmt8 := math.NewInt(500_000_000) + matchedAmt9 := math.NewInt(600_000_000) + matchedAmt10 := math.NewInt(100_000_000) - totalMatchedAmt := sdk.NewInt(3700_000_000).Add(matchedAmt7) + totalMatchedAmt := math.NewInt(3700_000_000).Add(matchedAmt7) s.Require().Equal(mInfo.TotalMatchedAmount, totalMatchedAmt) s.Require().Equal(mInfo.AllocationMap[s.addr(1).String()], matchedAmt1) @@ -649,16 +657,16 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed2_LimitedSame() { s.Require().Equal(mInfo.AllocationMap[s.addr(9).String()], matchedAmt9) s.Require().Equal(mInfo.AllocationMap[s.addr(10).String()], matchedAmt10) - reservedMatchedAmt1 := sdk.NewInt(420_000_000) - reservedMatchedAmt2 := sdk.NewInt(420_000_000) - reservedMatchedAmt3 := sdk.NewInt(420_000_000) - reservedMatchedAmt4 := sdk.NewInt(60_000_000) - reservedMatchedAmt5 := sdk.NewInt(180_000_000) - reservedMatchedAmt6 := sdk.NewInt(0) - reservedMatchedAmt7 := sdk.NewInt(400_000_000) - reservedMatchedAmt8 := sdk.NewInt(300_000_000) - reservedMatchedAmt9 := sdk.NewInt(360_000_000) - reservedMatchedAmt10 := sdk.NewInt(60_000_000) + reservedMatchedAmt1 := math.NewInt(420_000_000) + reservedMatchedAmt2 := math.NewInt(420_000_000) + reservedMatchedAmt3 := math.NewInt(420_000_000) + reservedMatchedAmt4 := math.NewInt(60_000_000) + reservedMatchedAmt5 := math.NewInt(180_000_000) + reservedMatchedAmt6 := math.NewInt(0) + reservedMatchedAmt7 := math.NewInt(400_000_000) + reservedMatchedAmt8 := math.NewInt(300_000_000) + reservedMatchedAmt9 := math.NewInt(360_000_000) + reservedMatchedAmt10 := math.NewInt(60_000_000) s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(1).String()], reservedMatchedAmt1) s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(2).String()], reservedMatchedAmt2) @@ -671,16 +679,16 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed2_LimitedSame() { s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(9).String()], reservedMatchedAmt9) s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(10).String()], reservedMatchedAmt10) - refundAmt1 := sdk.NewInt(80_000_000) - refundAmt2 := sdk.NewInt(150_000_000) - refundAmt3 := sdk.NewInt(820_000_000) - refundAmt4 := sdk.NewInt(20_000_000) - refundAmt5 := sdk.NewInt(180_000_000) - refundAmt6 := sdk.NewInt(400_000_000) - refundAmt7 := sdk.NewInt(0) - refundAmt8 := sdk.NewInt(100_000_000) - refundAmt9 := sdk.NewInt(0) - refundAmt10 := sdk.NewInt(0) + refundAmt1 := math.NewInt(80_000_000) + refundAmt2 := math.NewInt(150_000_000) + refundAmt3 := math.NewInt(820_000_000) + refundAmt4 := math.NewInt(20_000_000) + refundAmt5 := math.NewInt(180_000_000) + refundAmt6 := math.NewInt(400_000_000) + refundAmt7 := math.NewInt(0) + refundAmt8 := math.NewInt(100_000_000) + refundAmt9 := math.NewInt(0) + refundAmt10 := math.NewInt(0) s.Require().True(mInfo.RefundMap[s.addr(1).String()].Equal(refundAmt1)) s.Require().True(mInfo.RefundMap[s.addr(2).String()].Equal(refundAmt2)) @@ -694,7 +702,7 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed2_LimitedSame() { s.Require().True(mInfo.RefundMap[s.addr(10).String()].Equal(refundAmt10)) // Distribute selling coin - err := s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) + err = s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) s.Require().NoError(err) err = s.keeper.RefundRemainingSellingCoin(s.ctx, auction) @@ -732,51 +740,52 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed2_LimitedDifferent() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("1"), parseCoin("200_000_000denom1"), sdk.NewInt(1000_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(2), parseDec("0.8"), parseCoin("500_000_000denom2"), sdk.NewInt(1000_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("0.9"), parseCoin("500_000_000denom1"), sdk.NewInt(800_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(1), parseDec("1.1"), parseCoin("300_000_000denom2"), sdk.NewInt(0), true) - s.placeBidBatchMany(auction.Id, s.addr(5), parseDec("1.2"), parseCoin("300_000_000denom1"), sdk.NewInt(600_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(4), parseDec("0.8"), parseCoin("100_000_000denom1"), sdk.NewInt(800_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(2), parseDec("0.7"), parseCoin("100_000_000denom1"), sdk.NewInt(0), true) - s.placeBidBatchMany(auction.Id, s.addr(6), parseDec("0.5"), parseCoin("100_000_000denom1"), sdk.NewInt(600_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.8"), parseCoin("300_000_000denom2"), sdk.NewInt(0), true) - s.placeBidBatchWorth(auction.Id, s.addr(7), parseDec("0.6"), parseCoin("200_000_000denom2"), sdk.NewInt(400_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(8), parseDec("0.8"), parseCoin("400_000_000denom1"), sdk.NewInt(400_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(9), parseDec("0.6"), parseCoin("200_000_000denom1"), sdk.NewInt(200_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(6), parseDec("0.5"), parseCoin("300_000_000denom2"), sdk.NewInt(0), true) - s.placeBidBatchMany(auction.Id, s.addr(10), parseDec("0.6"), parseCoin("100_000_000denom1"), sdk.NewInt(200_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.7"), parseCoin("560_000_000denom2"), sdk.NewInt(0), true) - - a, found := s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) - - mInfo := s.keeper.CalculateBatchAllocation(s.ctx, a) + s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("1"), parseCoin("200_000_000denom1"), math.NewInt(1000_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(2), parseDec("0.8"), parseCoin("500_000_000denom2"), math.NewInt(1000_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("0.9"), parseCoin("500_000_000denom1"), math.NewInt(800_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(1), parseDec("1.1"), parseCoin("300_000_000denom2"), math.NewInt(0), true) + s.placeBidBatchMany(auction.Id, s.addr(5), parseDec("1.2"), parseCoin("300_000_000denom1"), math.NewInt(600_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(4), parseDec("0.8"), parseCoin("100_000_000denom1"), math.NewInt(800_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(2), parseDec("0.7"), parseCoin("100_000_000denom1"), math.NewInt(0), true) + s.placeBidBatchMany(auction.Id, s.addr(6), parseDec("0.5"), parseCoin("100_000_000denom1"), math.NewInt(600_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.8"), parseCoin("300_000_000denom2"), math.NewInt(0), true) + s.placeBidBatchWorth(auction.Id, s.addr(7), parseDec("0.6"), parseCoin("200_000_000denom2"), math.NewInt(400_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(8), parseDec("0.8"), parseCoin("400_000_000denom1"), math.NewInt(400_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(9), parseDec("0.6"), parseCoin("200_000_000denom1"), math.NewInt(200_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(6), parseDec("0.5"), parseCoin("300_000_000denom2"), math.NewInt(0), true) + s.placeBidBatchMany(auction.Id, s.addr(10), parseDec("0.6"), parseCoin("100_000_000denom1"), math.NewInt(200_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(3), parseDec("0.7"), parseCoin("560_000_000denom2"), math.NewInt(0), true) + + a, err := s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) + + mInfo, err := s.keeper.CalculateBatchAllocation(s.ctx, a) + s.Require().NoError(err) // Checking s.Require().Equal(int64(13), mInfo.MatchedLen) matchingPrice := parseDec("0.5") s.Require().Equal(mInfo.MatchedPrice, matchingPrice) - matchedAmt1 := sdk.NewInt(800_000_000) - matchedAmt2 := sdk.NewInt(1000_000_000) - matchedAmt3 := sdk.NewInt(800_000_000) - matchedAmt4 := sdk.NewInt(100_000_000) - matchedAmt5 := sdk.NewInt(300_000_000) - matchedAmt6 := sdk.NewInt(600_000_000) - matchedAmt7 := sdk.NewInt(400_000_000) - matchedAmt8 := sdk.NewInt(400_000_000) - matchedAmt9 := sdk.NewInt(200_000_000) - matchedAmt10 := sdk.NewInt(100_000_000) + matchedAmt1 := math.NewInt(800_000_000) + matchedAmt2 := math.NewInt(1000_000_000) + matchedAmt3 := math.NewInt(800_000_000) + matchedAmt4 := math.NewInt(100_000_000) + matchedAmt5 := math.NewInt(300_000_000) + matchedAmt6 := math.NewInt(600_000_000) + matchedAmt7 := math.NewInt(400_000_000) + matchedAmt8 := math.NewInt(400_000_000) + matchedAmt9 := math.NewInt(200_000_000) + matchedAmt10 := math.NewInt(100_000_000) - totalMatchedAmt := sdk.NewInt(4700_000_000) + totalMatchedAmt := math.NewInt(4700_000_000) s.Require().Equal(mInfo.TotalMatchedAmount, totalMatchedAmt) s.Require().Equal(mInfo.AllocationMap[s.addr(1).String()], matchedAmt1) @@ -790,16 +799,16 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed2_LimitedDifferent() { s.Require().Equal(mInfo.AllocationMap[s.addr(9).String()], matchedAmt9) s.Require().Equal(mInfo.AllocationMap[s.addr(10).String()], matchedAmt10) - reservedMatchedAmt1 := sdk.NewInt(400_000_000) - reservedMatchedAmt2 := sdk.NewInt(500_000_000) - reservedMatchedAmt3 := sdk.NewInt(400_000_000) - reservedMatchedAmt4 := sdk.NewInt(50_000_000) - reservedMatchedAmt5 := sdk.NewInt(150_000_000) - reservedMatchedAmt6 := sdk.NewInt(300_000_000) - reservedMatchedAmt7 := sdk.NewInt(200_000_000) - reservedMatchedAmt8 := sdk.NewInt(200_000_000) - reservedMatchedAmt9 := sdk.NewInt(100_000_000) - reservedMatchedAmt10 := sdk.NewInt(50_000_000) + reservedMatchedAmt1 := math.NewInt(400_000_000) + reservedMatchedAmt2 := math.NewInt(500_000_000) + reservedMatchedAmt3 := math.NewInt(400_000_000) + reservedMatchedAmt4 := math.NewInt(50_000_000) + reservedMatchedAmt5 := math.NewInt(150_000_000) + reservedMatchedAmt6 := math.NewInt(300_000_000) + reservedMatchedAmt7 := math.NewInt(200_000_000) + reservedMatchedAmt8 := math.NewInt(200_000_000) + reservedMatchedAmt9 := math.NewInt(100_000_000) + reservedMatchedAmt10 := math.NewInt(50_000_000) s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(1).String()], reservedMatchedAmt1) s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(2).String()], reservedMatchedAmt2) @@ -812,16 +821,16 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed2_LimitedDifferent() { s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(9).String()], reservedMatchedAmt9) s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(10).String()], reservedMatchedAmt10) - refundAmt1 := sdk.NewInt(100_000_000) - refundAmt2 := sdk.NewInt(70_000_000) - refundAmt3 := sdk.NewInt(910_000_000) - refundAmt4 := sdk.NewInt(30_000_000) - refundAmt5 := sdk.NewInt(210_000_000) - refundAmt6 := sdk.NewInt(50_000_000) - refundAmt7 := sdk.NewInt(0) - refundAmt8 := sdk.NewInt(120_000_000) - refundAmt9 := sdk.NewInt(20_000_000) - refundAmt10 := sdk.NewInt(10_000_000) + refundAmt1 := math.NewInt(100_000_000) + refundAmt2 := math.NewInt(70_000_000) + refundAmt3 := math.NewInt(910_000_000) + refundAmt4 := math.NewInt(30_000_000) + refundAmt5 := math.NewInt(210_000_000) + refundAmt6 := math.NewInt(50_000_000) + refundAmt7 := math.NewInt(0) + refundAmt8 := math.NewInt(120_000_000) + refundAmt9 := math.NewInt(20_000_000) + refundAmt10 := math.NewInt(10_000_000) s.Require().True(mInfo.RefundMap[s.addr(1).String()].Equal(refundAmt1)) s.Require().True(mInfo.RefundMap[s.addr(2).String()].Equal(refundAmt2)) @@ -835,7 +844,7 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed2_LimitedDifferent() { s.Require().True(mInfo.RefundMap[s.addr(10).String()].Equal(refundAmt10)) // Distribute selling coin - err := s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) + err = s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) s.Require().NoError(err) err = s.keeper.RefundRemainingSellingCoin(s.ctx, auction) @@ -845,7 +854,7 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed2_LimitedDifferent() { s.Require().True(s.getBalance(auction.GetSellingReserveAddress(), auction.SellingCoin.Denom).IsZero()) // The auctioneer must have sellingCoin.Amount - TotalMatchedAmount - s.Require().Equal(s.getBalance(s.addr(0), auction.GetSellingCoin().Denom).Amount, sdk.NewInt(300_000_000)) + s.Require().Equal(s.getBalance(s.addr(0), auction.GetSellingCoin().Denom).Amount, math.NewInt(300_000_000)) // The bidders must have the matched selling coin s.Require().Equal(s.getBalance(s.addr(1), auction.GetSellingCoin().Denom).Amount, matchedAmt1) @@ -873,61 +882,62 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed3() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("10"), parseCoin("200_000_000denom1"), sdk.NewInt(2500_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(2), parseDec("11"), parseCoin("2000_000_000denom2"), sdk.NewInt(2500_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("10.5"), parseCoin("500_000_000denom1"), sdk.NewInt(2500_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(4), parseDec("10.2"), parseCoin("1500_000_000denom2"), sdk.NewInt(2500_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(5), parseDec("10.8"), parseCoin("300_000_000denom1"), sdk.NewInt(2500_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(6), parseDec("11.4"), parseCoin("2500_000_000denom2"), sdk.NewInt(2500_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(7), parseDec("11.3"), parseCoin("100_000_000denom1"), sdk.NewInt(2500_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(8), parseDec("9.9"), parseCoin("2500_000_000denom2"), sdk.NewInt(2500_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(9), parseDec("10.1"), parseCoin("300_000_000denom1"), sdk.NewInt(2500_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(10), parseDec("10.45"), parseCoin("2000_000_000denom2"), sdk.NewInt(2500_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(11), parseDec("10.75"), parseCoin("150_000_000denom1"), sdk.NewInt(2500_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(12), parseDec("10.99"), parseCoin("1500_000_000denom2"), sdk.NewInt(2500_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(13), parseDec("10.2"), parseCoin("200_000_000denom1"), sdk.NewInt(2500_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(14), parseDec("9.87"), parseCoin("2000_000_000denom2"), sdk.NewInt(2500_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(15), parseDec("10.25"), parseCoin("200_000_000denom1"), sdk.NewInt(2500_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(16), parseDec("10.48"), parseCoin("2500_000_000denom2"), sdk.NewInt(2500_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(17), parseDec("10.52"), parseCoin("180_000_000denom1"), sdk.NewInt(2500_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(4), parseDec("10.8"), parseCoin("220_000_000denom1"), sdk.NewInt(0), true) - s.placeBidBatchWorth(auction.Id, s.addr(5), parseDec("10.5"), parseCoin("1500_000_000denom2"), sdk.NewInt(0), true) - s.placeBidBatchMany(auction.Id, s.addr(6), parseDec("9.7"), parseCoin("250_000_000denom1"), sdk.NewInt(0), true) - - a, found := s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) - - mInfo := s.keeper.CalculateBatchAllocation(s.ctx, a) + s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("10"), parseCoin("200_000_000denom1"), math.NewInt(2500_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(2), parseDec("11"), parseCoin("2000_000_000denom2"), math.NewInt(2500_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("10.5"), parseCoin("500_000_000denom1"), math.NewInt(2500_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(4), parseDec("10.2"), parseCoin("1500_000_000denom2"), math.NewInt(2500_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(5), parseDec("10.8"), parseCoin("300_000_000denom1"), math.NewInt(2500_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(6), parseDec("11.4"), parseCoin("2500_000_000denom2"), math.NewInt(2500_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(7), parseDec("11.3"), parseCoin("100_000_000denom1"), math.NewInt(2500_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(8), parseDec("9.9"), parseCoin("2500_000_000denom2"), math.NewInt(2500_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(9), parseDec("10.1"), parseCoin("300_000_000denom1"), math.NewInt(2500_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(10), parseDec("10.45"), parseCoin("2000_000_000denom2"), math.NewInt(2500_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(11), parseDec("10.75"), parseCoin("150_000_000denom1"), math.NewInt(2500_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(12), parseDec("10.99"), parseCoin("1500_000_000denom2"), math.NewInt(2500_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(13), parseDec("10.2"), parseCoin("200_000_000denom1"), math.NewInt(2500_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(14), parseDec("9.87"), parseCoin("2000_000_000denom2"), math.NewInt(2500_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(15), parseDec("10.25"), parseCoin("200_000_000denom1"), math.NewInt(2500_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(16), parseDec("10.48"), parseCoin("2500_000_000denom2"), math.NewInt(2500_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(17), parseDec("10.52"), parseCoin("180_000_000denom1"), math.NewInt(2500_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(4), parseDec("10.8"), parseCoin("220_000_000denom1"), math.NewInt(0), true) + s.placeBidBatchWorth(auction.Id, s.addr(5), parseDec("10.5"), parseCoin("1500_000_000denom2"), math.NewInt(0), true) + s.placeBidBatchMany(auction.Id, s.addr(6), parseDec("9.7"), parseCoin("250_000_000denom1"), math.NewInt(0), true) + + a, err := s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) + + mInfo, err := s.keeper.CalculateBatchAllocation(s.ctx, a) + s.Require().NoError(err) // Checking s.Require().Equal(mInfo.MatchedLen, int64(11)) matchingPrice := parseDec("10.48") s.Require().Equal(mInfo.MatchedPrice, matchingPrice) - matchedAmt1 := sdk.NewInt(0) - matchedAmt2 := sdk.NewDec(2000_000_000).QuoTruncate(matchingPrice).TruncateInt() - matchedAmt3 := sdk.NewInt(500_000_000) - matchedAmt4 := sdk.NewInt(220_000_000) - matchedAmt5 := sdk.NewDec(1500_000_000).QuoTruncate(matchingPrice).TruncateInt().Add(sdk.NewInt(300_000_000)) - matchedAmt6 := sdk.NewDec(2500_000_000).QuoTruncate(matchingPrice).TruncateInt() - matchedAmt7 := sdk.NewInt(100_000_000) - matchedAmt8 := sdk.NewInt(0) - matchedAmt9 := sdk.NewInt(0) - matchedAmt10 := sdk.NewInt(0) - matchedAmt11 := sdk.NewInt(150_000_000) - matchedAmt12 := sdk.NewDec(1500_000_000).QuoTruncate(matchingPrice).TruncateInt() - matchedAmt13 := sdk.NewInt(0) - matchedAmt14 := sdk.NewInt(0) - matchedAmt15 := sdk.NewInt(0) - matchedAmt16 := sdk.NewDec(2500_000_000).QuoTruncate(matchingPrice).TruncateInt() - matchedAmt17 := sdk.NewInt(180_000_000) + matchedAmt1 := math.NewInt(0) + matchedAmt2 := math.LegacyNewDec(2000_000_000).QuoTruncate(matchingPrice).TruncateInt() + matchedAmt3 := math.NewInt(500_000_000) + matchedAmt4 := math.NewInt(220_000_000) + matchedAmt5 := math.LegacyNewDec(1500_000_000).QuoTruncate(matchingPrice).TruncateInt().Add(math.NewInt(300_000_000)) + matchedAmt6 := math.LegacyNewDec(2500_000_000).QuoTruncate(matchingPrice).TruncateInt() + matchedAmt7 := math.NewInt(100_000_000) + matchedAmt8 := math.NewInt(0) + matchedAmt9 := math.NewInt(0) + matchedAmt10 := math.NewInt(0) + matchedAmt11 := math.NewInt(150_000_000) + matchedAmt12 := math.LegacyNewDec(1500_000_000).QuoTruncate(matchingPrice).TruncateInt() + matchedAmt13 := math.NewInt(0) + matchedAmt14 := math.NewInt(0) + matchedAmt15 := math.NewInt(0) + matchedAmt16 := math.LegacyNewDec(2500_000_000).QuoTruncate(matchingPrice).TruncateInt() + matchedAmt17 := math.NewInt(180_000_000) totalMatchedAmt := matchedAmt2.Add(matchedAmt3). Add(matchedAmt4). @@ -958,23 +968,23 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed3() { s.Require().Equal(mInfo.AllocationMap[s.addr(16).String()], matchedAmt16) s.Require().Equal(mInfo.AllocationMap[s.addr(17).String()], matchedAmt17) - reservedMatchedAmt1 := sdk.NewInt(0) - reservedMatchedAmt2 := sdk.NewInt(1999_999_994) - reservedMatchedAmt3 := sdk.NewDecFromInt(matchedAmt3).Mul(matchingPrice).Ceil().TruncateInt() - reservedMatchedAmt4 := sdk.NewDecFromInt(matchedAmt4).Mul(matchingPrice).Ceil().TruncateInt() - reservedMatchedAmt5 := sdk.NewDecFromInt(matchedAmt5).Mul(matchingPrice).Ceil().TruncateInt() - reservedMatchedAmt6 := sdk.NewInt(2499_999_997) - reservedMatchedAmt7 := sdk.NewDecFromInt(matchedAmt7).Mul(matchingPrice).Ceil().TruncateInt() - reservedMatchedAmt8 := sdk.NewInt(0) - reservedMatchedAmt9 := sdk.NewInt(0) - reservedMatchedAmt10 := sdk.NewInt(0) - reservedMatchedAmt11 := sdk.NewDecFromInt(matchedAmt11).Mul(matchingPrice).Ceil().TruncateInt() - reservedMatchedAmt12 := sdk.NewInt(1499_999_990) - reservedMatchedAmt13 := sdk.NewInt(0) - reservedMatchedAmt14 := sdk.NewInt(0) - reservedMatchedAmt15 := sdk.NewInt(0) - reservedMatchedAmt16 := sdk.NewInt(2499_999_997) - reservedMatchedAmt17 := sdk.NewDecFromInt(matchedAmt17).Mul(matchingPrice).Ceil().TruncateInt() + reservedMatchedAmt1 := math.NewInt(0) + reservedMatchedAmt2 := math.NewInt(1999_999_994) + reservedMatchedAmt3 := math.LegacyNewDecFromInt(matchedAmt3).Mul(matchingPrice).Ceil().TruncateInt() + reservedMatchedAmt4 := math.LegacyNewDecFromInt(matchedAmt4).Mul(matchingPrice).Ceil().TruncateInt() + reservedMatchedAmt5 := math.LegacyNewDecFromInt(matchedAmt5).Mul(matchingPrice).Ceil().TruncateInt() + reservedMatchedAmt6 := math.NewInt(2499_999_997) + reservedMatchedAmt7 := math.LegacyNewDecFromInt(matchedAmt7).Mul(matchingPrice).Ceil().TruncateInt() + reservedMatchedAmt8 := math.NewInt(0) + reservedMatchedAmt9 := math.NewInt(0) + reservedMatchedAmt10 := math.NewInt(0) + reservedMatchedAmt11 := math.LegacyNewDecFromInt(matchedAmt11).Mul(matchingPrice).Ceil().TruncateInt() + reservedMatchedAmt12 := math.NewInt(1499_999_990) + reservedMatchedAmt13 := math.NewInt(0) + reservedMatchedAmt14 := math.NewInt(0) + reservedMatchedAmt15 := math.NewInt(0) + reservedMatchedAmt16 := math.NewInt(2499_999_997) + reservedMatchedAmt17 := math.LegacyNewDecFromInt(matchedAmt17).Mul(matchingPrice).Ceil().TruncateInt() s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(1).String()], reservedMatchedAmt1) s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(2).String()], reservedMatchedAmt2) @@ -994,23 +1004,23 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed3() { s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(16).String()], reservedMatchedAmt16) s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(17).String()], reservedMatchedAmt17) - refundAmt1 := sdk.NewDec(200_000_000).Mul(parseDec("10")).Ceil().TruncateInt() - refundAmt2 := sdk.NewInt(2000_000_000).Sub(reservedMatchedAmt2) - refundAmt3 := sdk.NewDec(500_000_000).Mul(parseDec("10.5")).Ceil().TruncateInt().Sub(reservedMatchedAmt3) - refundAmt4 := sdk.NewDec(220_000_000).Mul(parseDec("10.8")).Ceil().TruncateInt().Add(sdk.NewInt(1500_000_000)).Sub(reservedMatchedAmt4) - refundAmt5 := sdk.NewDec(300_000_000).Mul(parseDec("10.8")).Ceil().TruncateInt().Add(sdk.NewInt(1500_000_000)).Sub(reservedMatchedAmt5) - refundAmt6 := sdk.NewDec(250_000_000).Mul(parseDec("9.7")).Ceil().TruncateInt().Add(sdk.NewInt(2500_000_000)).Sub(reservedMatchedAmt6) - refundAmt7 := sdk.NewDec(100_000_000).Mul(parseDec("11.3")).Ceil().TruncateInt().Sub(reservedMatchedAmt7) - refundAmt8 := sdk.NewInt(2500_000_000) - refundAmt9 := sdk.NewDec(300_000_000).Mul(parseDec("10.1")).Ceil().TruncateInt() - refundAmt10 := sdk.NewInt(2000_000_000) - refundAmt11 := sdk.NewDec(150_000_000).Mul(parseDec("10.75")).Ceil().TruncateInt().Sub(reservedMatchedAmt11) - refundAmt12 := sdk.NewInt(1500_000_000).Sub(reservedMatchedAmt12) - refundAmt13 := sdk.NewDec(200_000_000).Mul(parseDec("10.2")).Ceil().TruncateInt() - refundAmt14 := sdk.NewInt(2000_000_000) - refundAmt15 := sdk.NewDec(200_000_000).Mul(parseDec("10.25")).Ceil().TruncateInt() - refundAmt16 := sdk.NewInt(2500_000_000).Sub(reservedMatchedAmt16) - refundAmt17 := sdk.NewDec(180_000_000).Mul(parseDec("10.52")).Ceil().TruncateInt().Sub(reservedMatchedAmt17) + refundAmt1 := math.LegacyNewDec(200_000_000).Mul(parseDec("10")).Ceil().TruncateInt() + refundAmt2 := math.NewInt(2000_000_000).Sub(reservedMatchedAmt2) + refundAmt3 := math.LegacyNewDec(500_000_000).Mul(parseDec("10.5")).Ceil().TruncateInt().Sub(reservedMatchedAmt3) + refundAmt4 := math.LegacyNewDec(220_000_000).Mul(parseDec("10.8")).Ceil().TruncateInt().Add(math.NewInt(1500_000_000)).Sub(reservedMatchedAmt4) + refundAmt5 := math.LegacyNewDec(300_000_000).Mul(parseDec("10.8")).Ceil().TruncateInt().Add(math.NewInt(1500_000_000)).Sub(reservedMatchedAmt5) + refundAmt6 := math.LegacyNewDec(250_000_000).Mul(parseDec("9.7")).Ceil().TruncateInt().Add(math.NewInt(2500_000_000)).Sub(reservedMatchedAmt6) + refundAmt7 := math.LegacyNewDec(100_000_000).Mul(parseDec("11.3")).Ceil().TruncateInt().Sub(reservedMatchedAmt7) + refundAmt8 := math.NewInt(2500_000_000) + refundAmt9 := math.LegacyNewDec(300_000_000).Mul(parseDec("10.1")).Ceil().TruncateInt() + refundAmt10 := math.NewInt(2000_000_000) + refundAmt11 := math.LegacyNewDec(150_000_000).Mul(parseDec("10.75")).Ceil().TruncateInt().Sub(reservedMatchedAmt11) + refundAmt12 := math.NewInt(1500_000_000).Sub(reservedMatchedAmt12) + refundAmt13 := math.LegacyNewDec(200_000_000).Mul(parseDec("10.2")).Ceil().TruncateInt() + refundAmt14 := math.NewInt(2000_000_000) + refundAmt15 := math.LegacyNewDec(200_000_000).Mul(parseDec("10.25")).Ceil().TruncateInt() + refundAmt16 := math.NewInt(2500_000_000).Sub(reservedMatchedAmt16) + refundAmt17 := math.LegacyNewDec(180_000_000).Mul(parseDec("10.52")).Ceil().TruncateInt().Sub(reservedMatchedAmt17) s.Require().True(mInfo.RefundMap[s.addr(1).String()].Equal(refundAmt1)) s.Require().True(mInfo.RefundMap[s.addr(2).String()].Equal(refundAmt2)) @@ -1031,7 +1041,7 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed3() { s.Require().True(mInfo.RefundMap[s.addr(17).String()].Equal(refundAmt17)) // Distribute selling coin - err := s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) + err = s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) s.Require().NoError(err) err = s.keeper.RefundRemainingSellingCoin(s.ctx, auction) @@ -1076,61 +1086,62 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed3_LimitedDifferent() { "denom2", []types.VestingSchedule{}, 1, - sdk.MustNewDecFromStr("0.2"), + math.LegacyMustNewDecFromStr("0.2"), time.Now().AddDate(0, 0, -1), time.Now().AddDate(0, 0, -1).AddDate(0, 2, 0), true, ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("10"), parseCoin("200_000_000denom1"), sdk.NewInt(500_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(2), parseDec("11"), parseCoin("2000_000_000denom2"), sdk.NewInt(500_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("10.5"), parseCoin("500_000_000denom1"), sdk.NewInt(500_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(4), parseDec("10.2"), parseCoin("1500_000_000denom2"), sdk.NewInt(200_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(5), parseDec("10.8"), parseCoin("200_000_000denom1"), sdk.NewInt(200_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(6), parseDec("11.4"), parseCoin("2200_000_000denom2"), sdk.NewInt(200_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(7), parseDec("11.3"), parseCoin("100_000_000denom1"), sdk.NewInt(200_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(8), parseDec("9.9"), parseCoin("1900_000_000denom2"), sdk.NewInt(200_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(9), parseDec("10.1"), parseCoin("200_000_000denom1"), sdk.NewInt(200_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(10), parseDec("10.45"), parseCoin("2000_000_000denom2"), sdk.NewInt(200_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(11), parseDec("10.75"), parseCoin("100_000_000denom1"), sdk.NewInt(100_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(12), parseDec("10.99"), parseCoin("1050_000_000denom2"), sdk.NewInt(100_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(13), parseDec("10.2"), parseCoin("100_000_000denom1"), sdk.NewInt(100_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(14), parseDec("9.87"), parseCoin("980_000_000denom2"), sdk.NewInt(100_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(15), parseDec("10.25"), parseCoin("100_000_000denom1"), sdk.NewInt(100_000_000), true) - s.placeBidBatchWorth(auction.Id, s.addr(16), parseDec("10.48"), parseCoin("1000_000_000denom2"), sdk.NewInt(100_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(17), parseDec("10.52"), parseCoin("100_000_000denom1"), sdk.NewInt(100_000_000), true) - s.placeBidBatchMany(auction.Id, s.addr(4), parseDec("10.8"), parseCoin("200_000_000denom1"), sdk.NewInt(0), true) - s.placeBidBatchWorth(auction.Id, s.addr(5), parseDec("10.5"), parseCoin("1500_000_000denom2"), sdk.NewInt(0), true) - s.placeBidBatchMany(auction.Id, s.addr(6), parseDec("9.7"), parseCoin("200_000_000denom1"), sdk.NewInt(0), true) - - a, found := s.keeper.GetAuction(s.ctx, auction.Id) - s.Require().True(found) - - mInfo := s.keeper.CalculateBatchAllocation(s.ctx, a) + s.placeBidBatchMany(auction.Id, s.addr(1), parseDec("10"), parseCoin("200_000_000denom1"), math.NewInt(500_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(2), parseDec("11"), parseCoin("2000_000_000denom2"), math.NewInt(500_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(3), parseDec("10.5"), parseCoin("500_000_000denom1"), math.NewInt(500_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(4), parseDec("10.2"), parseCoin("1500_000_000denom2"), math.NewInt(200_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(5), parseDec("10.8"), parseCoin("200_000_000denom1"), math.NewInt(200_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(6), parseDec("11.4"), parseCoin("2200_000_000denom2"), math.NewInt(200_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(7), parseDec("11.3"), parseCoin("100_000_000denom1"), math.NewInt(200_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(8), parseDec("9.9"), parseCoin("1900_000_000denom2"), math.NewInt(200_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(9), parseDec("10.1"), parseCoin("200_000_000denom1"), math.NewInt(200_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(10), parseDec("10.45"), parseCoin("2000_000_000denom2"), math.NewInt(200_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(11), parseDec("10.75"), parseCoin("100_000_000denom1"), math.NewInt(100_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(12), parseDec("10.99"), parseCoin("1050_000_000denom2"), math.NewInt(100_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(13), parseDec("10.2"), parseCoin("100_000_000denom1"), math.NewInt(100_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(14), parseDec("9.87"), parseCoin("980_000_000denom2"), math.NewInt(100_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(15), parseDec("10.25"), parseCoin("100_000_000denom1"), math.NewInt(100_000_000), true) + s.placeBidBatchWorth(auction.Id, s.addr(16), parseDec("10.48"), parseCoin("1000_000_000denom2"), math.NewInt(100_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(17), parseDec("10.52"), parseCoin("100_000_000denom1"), math.NewInt(100_000_000), true) + s.placeBidBatchMany(auction.Id, s.addr(4), parseDec("10.8"), parseCoin("200_000_000denom1"), math.NewInt(0), true) + s.placeBidBatchWorth(auction.Id, s.addr(5), parseDec("10.5"), parseCoin("1500_000_000denom2"), math.NewInt(0), true) + s.placeBidBatchMany(auction.Id, s.addr(6), parseDec("9.7"), parseCoin("200_000_000denom1"), math.NewInt(0), true) + + a, err := s.keeper.Auction.Get(s.ctx, auction.Id) + s.Require().NoError(err) + + mInfo, err := s.keeper.CalculateBatchAllocation(s.ctx, a) + s.Require().NoError(err) // Checking s.Require().Equal(int64(14), mInfo.MatchedLen) matchingPrice := parseDec("10.1") s.Require().Equal(mInfo.MatchedPrice, matchingPrice) - matchedAmt1 := sdk.NewInt(0) - matchedAmt2 := sdk.NewDec(2000_000_000).QuoTruncate(matchingPrice).TruncateInt() - matchedAmt3 := sdk.NewInt(500_000_000) - matchedAmt4 := sdk.NewInt(200_000_000) - matchedAmt5 := sdk.NewInt(200_000_000) - matchedAmt6 := sdk.NewInt(200_000_000) - matchedAmt7 := sdk.NewInt(100_000_000) - matchedAmt8 := sdk.NewInt(0) - matchedAmt9 := sdk.NewInt(200_000_000) - matchedAmt10 := sdk.NewDec(2000_000_000).QuoTruncate(matchingPrice).TruncateInt() - matchedAmt11 := sdk.NewInt(100_000_000) - matchedAmt12 := sdk.NewInt(100_000_000) - matchedAmt13 := sdk.NewInt(100_000_000) - matchedAmt14 := sdk.NewInt(0) - matchedAmt15 := sdk.NewInt(100_000_000) - matchedAmt16 := sdk.NewDec(1000_000_000).QuoTruncate(matchingPrice).TruncateInt() - matchedAmt17 := sdk.NewInt(100_000_000) + matchedAmt1 := math.NewInt(0) + matchedAmt2 := math.LegacyNewDec(2000_000_000).QuoTruncate(matchingPrice).TruncateInt() + matchedAmt3 := math.NewInt(500_000_000) + matchedAmt4 := math.NewInt(200_000_000) + matchedAmt5 := math.NewInt(200_000_000) + matchedAmt6 := math.NewInt(200_000_000) + matchedAmt7 := math.NewInt(100_000_000) + matchedAmt8 := math.NewInt(0) + matchedAmt9 := math.NewInt(200_000_000) + matchedAmt10 := math.LegacyNewDec(2000_000_000).QuoTruncate(matchingPrice).TruncateInt() + matchedAmt11 := math.NewInt(100_000_000) + matchedAmt12 := math.NewInt(100_000_000) + matchedAmt13 := math.NewInt(100_000_000) + matchedAmt14 := math.NewInt(0) + matchedAmt15 := math.NewInt(100_000_000) + matchedAmt16 := math.LegacyNewDec(1000_000_000).QuoTruncate(matchingPrice).TruncateInt() + matchedAmt17 := math.NewInt(100_000_000) totalMatchedAmt := matchedAmt2.Add(matchedAmt3). Add(matchedAmt4). @@ -1165,23 +1176,23 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed3_LimitedDifferent() { s.Require().Equal(mInfo.AllocationMap[s.addr(16).String()], matchedAmt16) s.Require().Equal(mInfo.AllocationMap[s.addr(17).String()], matchedAmt17) - reservedMatchedAmt1 := sdk.NewInt(0) - reservedMatchedAmt2 := sdk.NewInt(1999_999_991) - reservedMatchedAmt3 := sdk.NewInt(5050_000_000) - reservedMatchedAmt4 := sdk.NewInt(2020_000_000) - reservedMatchedAmt5 := sdk.NewInt(2020_000_000) - reservedMatchedAmt6 := sdk.NewInt(2020_000_000) - reservedMatchedAmt7 := sdk.NewInt(1010_000_000) - reservedMatchedAmt8 := sdk.NewInt(0) - reservedMatchedAmt9 := sdk.NewInt(2020_000_000) - reservedMatchedAmt10 := sdk.NewInt(1999_999_991) - reservedMatchedAmt11 := sdk.NewInt(1010_000_000) - reservedMatchedAmt12 := sdk.NewInt(1010_000_000) - reservedMatchedAmt13 := sdk.NewInt(1010_000_000) - reservedMatchedAmt14 := sdk.NewInt(0) - reservedMatchedAmt15 := sdk.NewInt(1010_000_000) - reservedMatchedAmt16 := sdk.NewInt(999_999_990) - reservedMatchedAmt17 := sdk.NewInt(1010_000_000) + reservedMatchedAmt1 := math.NewInt(0) + reservedMatchedAmt2 := math.NewInt(1999_999_991) + reservedMatchedAmt3 := math.NewInt(5050_000_000) + reservedMatchedAmt4 := math.NewInt(2020_000_000) + reservedMatchedAmt5 := math.NewInt(2020_000_000) + reservedMatchedAmt6 := math.NewInt(2020_000_000) + reservedMatchedAmt7 := math.NewInt(1010_000_000) + reservedMatchedAmt8 := math.NewInt(0) + reservedMatchedAmt9 := math.NewInt(2020_000_000) + reservedMatchedAmt10 := math.NewInt(1999_999_991) + reservedMatchedAmt11 := math.NewInt(1010_000_000) + reservedMatchedAmt12 := math.NewInt(1010_000_000) + reservedMatchedAmt13 := math.NewInt(1010_000_000) + reservedMatchedAmt14 := math.NewInt(0) + reservedMatchedAmt15 := math.NewInt(1010_000_000) + reservedMatchedAmt16 := math.NewInt(999_999_990) + reservedMatchedAmt17 := math.NewInt(1010_000_000) s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(1).String()], reservedMatchedAmt1) s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(2).String()], reservedMatchedAmt2) @@ -1201,23 +1212,23 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed3_LimitedDifferent() { s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(16).String()], reservedMatchedAmt16) s.Require().Equal(mInfo.ReservedMatchedMap[s.addr(17).String()], reservedMatchedAmt17) - refundAmt1 := sdk.NewInt(2000_000_000) - refundAmt2 := sdk.NewInt(9) - refundAmt3 := sdk.NewInt(200_000_000) - refundAmt4 := sdk.NewInt(1640_000_000) - refundAmt5 := sdk.NewInt(1640_000_000) - refundAmt6 := sdk.NewInt(2120_000_000) - refundAmt7 := sdk.NewInt(120_000_000) - refundAmt8 := sdk.NewInt(1900_000_000) - refundAmt9 := sdk.NewInt(0) - refundAmt10 := sdk.NewInt(9) - refundAmt11 := sdk.NewInt(65_000_000) - refundAmt12 := sdk.NewInt(40_000_000) - refundAmt13 := sdk.NewInt(10_000_000) - refundAmt14 := sdk.NewInt(980_000_000) - refundAmt15 := sdk.NewInt(15_000_000) - refundAmt16 := sdk.NewInt(10) - refundAmt17 := sdk.NewInt(42_000_000) + refundAmt1 := math.NewInt(2000_000_000) + refundAmt2 := math.NewInt(9) + refundAmt3 := math.NewInt(200_000_000) + refundAmt4 := math.NewInt(1640_000_000) + refundAmt5 := math.NewInt(1640_000_000) + refundAmt6 := math.NewInt(2120_000_000) + refundAmt7 := math.NewInt(120_000_000) + refundAmt8 := math.NewInt(1900_000_000) + refundAmt9 := math.NewInt(0) + refundAmt10 := math.NewInt(9) + refundAmt11 := math.NewInt(65_000_000) + refundAmt12 := math.NewInt(40_000_000) + refundAmt13 := math.NewInt(10_000_000) + refundAmt14 := math.NewInt(980_000_000) + refundAmt15 := math.NewInt(15_000_000) + refundAmt16 := math.NewInt(10) + refundAmt17 := math.NewInt(42_000_000) s.Require().True(mInfo.RefundMap[s.addr(1).String()].Equal(refundAmt1)) s.Require().True(mInfo.RefundMap[s.addr(2).String()].Equal(refundAmt2)) @@ -1238,7 +1249,7 @@ func (s *KeeperTestSuite) TestCalculateAllocation_Mixed3_LimitedDifferent() { s.Require().True(mInfo.RefundMap[s.addr(17).String()].Equal(refundAmt17)) // Distribute selling coin - err := s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) + err = s.keeper.AllocateSellingCoin(s.ctx, auction, mInfo) s.Require().NoError(err) err = s.keeper.RefundRemainingSellingCoin(s.ctx, auction) diff --git a/x/fundraising/keeper/msg_server.go b/x/fundraising/keeper/msg_server.go index 5cbef055..9d1ab4e4 100644 --- a/x/fundraising/keeper/msg_server.go +++ b/x/fundraising/keeper/msg_server.go @@ -1,15 +1,10 @@ package keeper -// DONTCOVER - -// Although written in msg_server_test.go, it is approached at the keeper level rather than at the msgServer level -// so is not included in the coverage. - import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + sdkerrors "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/types/errors" "github.com/tendermint/fundraising/x/fundraising/types" ) @@ -26,73 +21,78 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { var _ types.MsgServer = msgServer{} -// CreateFixedPriceAuction defines a method to create fixed price auction. -func (m msgServer) CreateFixedPriceAuction(goCtx context.Context, msg *types.MsgCreateFixedPriceAuction) (*types.MsgCreateFixedPriceAuctionResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) +func (k msgServer) AddAllowedBidder(ctx context.Context, msg *types.MsgAddAllowedBidder) (*types.MsgAddAllowedBidderResponse, error) { + if _, err := k.addressCodec.StringToBytes(msg.AllowedBidder.Bidder); err != nil { + return nil, sdkerrors.Wrap(err, "invalid authority address") + } + + if !EnableAddAllowedBidder { + return nil, sdkerrors.Wrap(errors.ErrInvalidRequest, "EnableAddAllowedBidder is disabled") + } - if _, err := m.Keeper.CreateFixedPriceAuction(ctx, msg); err != nil { + if err := k.Keeper.AddAllowedBidders(ctx, msg.AuctionId, []types.AllowedBidder{msg.AllowedBidder}); err != nil { return nil, err } - return &types.MsgCreateFixedPriceAuctionResponse{}, nil + return &types.MsgAddAllowedBidderResponse{}, nil } -// CreateEnglishAuction defines a method to create english auction. -func (m msgServer) CreateBatchAuction(goCtx context.Context, msg *types.MsgCreateBatchAuction) (*types.MsgCreateBatchAuctionResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) +func (k msgServer) CancelAuction(ctx context.Context, msg *types.MsgCancelAuction) (*types.MsgCancelAuctionResponse, error) { + if _, err := k.addressCodec.StringToBytes(msg.Auctioneer); err != nil { + return nil, sdkerrors.Wrap(err, "invalid authority address") + } - if _, err := m.Keeper.CreateBatchAuction(ctx, msg); err != nil { + if err := k.Keeper.CancelAuction(ctx, msg); err != nil { return nil, err } - return &types.MsgCreateBatchAuctionResponse{}, nil + return &types.MsgCancelAuctionResponse{}, nil } -// CancelAuction defines a method to cancel auction. -func (m msgServer) CancelAuction(goCtx context.Context, msg *types.MsgCancelAuction) (*types.MsgCancelAuctionResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) +func (k msgServer) CreateBatchAuction(ctx context.Context, msg *types.MsgCreateBatchAuction) (*types.MsgCreateBatchAuctionResponse, error) { + if _, err := k.addressCodec.StringToBytes(msg.Auctioneer); err != nil { + return nil, sdkerrors.Wrap(err, "invalid authority address") + } - if err := m.Keeper.CancelAuction(ctx, msg); err != nil { + if _, err := k.Keeper.CreateBatchAuction(ctx, msg); err != nil { return nil, err } - return &types.MsgCancelAuctionResponse{}, nil + return &types.MsgCreateBatchAuctionResponse{}, nil } -// PlaceBid defines a method to place bid for the auction. -func (m msgServer) PlaceBid(goCtx context.Context, msg *types.MsgPlaceBid) (*types.MsgPlaceBidResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) +func (k msgServer) CreateFixedPriceAuction(ctx context.Context, msg *types.MsgCreateFixedPriceAuction) (*types.MsgCreateFixedPriceAuctionResponse, error) { + if _, err := k.addressCodec.StringToBytes(msg.Auctioneer); err != nil { + return nil, sdkerrors.Wrap(err, "invalid authority address") + } - if _, err := m.Keeper.PlaceBid(ctx, msg); err != nil { + if _, err := k.Keeper.CreateFixedPriceAuction(ctx, msg); err != nil { return nil, err } - return &types.MsgPlaceBidResponse{}, nil + return &types.MsgCreateFixedPriceAuctionResponse{}, nil } -// ModifyBid defines a method to modify the auctioneer's bid -func (m msgServer) ModifyBid(goCtx context.Context, msg *types.MsgModifyBid) (*types.MsgModifyBidResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) +func (k msgServer) ModifyBid(ctx context.Context, msg *types.MsgModifyBid) (*types.MsgModifyBidResponse, error) { + if _, err := k.addressCodec.StringToBytes(msg.Bidder); err != nil { + return nil, sdkerrors.Wrap(err, "invalid authority address") + } - if err := m.Keeper.ModifyBid(ctx, msg); err != nil { + if err := k.Keeper.ModifyBid(ctx, msg); err != nil { return nil, err } return &types.MsgModifyBidResponse{}, nil } -// AddAllowedBidder defines a method to add an allowed bidder. -// This message is created for testing purpose and it must not be used in mainnet. -func (m msgServer) AddAllowedBidder(goCtx context.Context, msg *types.MsgAddAllowedBidder) (*types.MsgAddAllowedBidderResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - if EnableAddAllowedBidder { - if err := m.Keeper.AddAllowedBidders(ctx, msg.AuctionId, []types.AllowedBidder{msg.AllowedBidder}); err != nil { - return nil, err - } - } else { - return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "EnableAddAllowedBidder is disabled") +func (k msgServer) PlaceBid(ctx context.Context, msg *types.MsgPlaceBid) (*types.MsgPlaceBidResponse, error) { + if _, err := k.addressCodec.StringToBytes(msg.Bidder); err != nil { + return nil, sdkerrors.Wrap(err, "invalid authority address") } - return &types.MsgAddAllowedBidderResponse{}, nil + if _, err := k.Keeper.PlaceBid(ctx, msg); err != nil { + return nil, err + } + + return &types.MsgPlaceBidResponse{}, nil } diff --git a/x/fundraising/keeper/msg_update_params.go b/x/fundraising/keeper/msg_update_params.go new file mode 100644 index 00000000..1805b04d --- /dev/null +++ b/x/fundraising/keeper/msg_update_params.go @@ -0,0 +1,29 @@ +package keeper + +import ( + "context" + + errorsmod "cosmossdk.io/errors" + + "github.com/tendermint/fundraising/x/fundraising/types" +) + +func (k msgServer) UpdateParams(ctx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if _, err := k.addressCodec.StringToBytes(req.Authority); err != nil { + return nil, errorsmod.Wrap(err, "invalid authority address") + } + + if k.GetAuthority() != req.Authority { + return nil, errorsmod.Wrapf(types.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.GetAuthority(), req.Authority) + } + + if err := req.Params.Validate(); err != nil { + return nil, err + } + + if err := k.Params.Set(ctx, req.Params); err != nil { + return nil, err + } + + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/fundraising/keeper/msg_update_params_test.go b/x/fundraising/keeper/msg_update_params_test.go new file mode 100644 index 00000000..947ad19d --- /dev/null +++ b/x/fundraising/keeper/msg_update_params_test.go @@ -0,0 +1,66 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + keepertest "github.com/tendermint/fundraising/testutil/keeper" + "github.com/tendermint/fundraising/x/fundraising/keeper" + "github.com/tendermint/fundraising/x/fundraising/types" +) + +func TestMsgUpdateParams(t *testing.T) { + k, ctx, _ := keepertest.FundraisingKeeper(t) + ms := keeper.NewMsgServerImpl(k) + + params := types.DefaultParams() + require.NoError(t, k.Params.Set(ctx, params)) + + // default params + testCases := []struct { + name string + input *types.MsgUpdateParams + expErr bool + expErrMsg string + }{ + { + name: "invalid authority", + input: &types.MsgUpdateParams{ + Authority: "invalid", + Params: params, + }, + expErr: true, + expErrMsg: "invalid authority", + }, + { + name: "send enabled param", + input: &types.MsgUpdateParams{ + Authority: k.GetAuthority(), + Params: types.Params{}, + }, + expErr: false, + }, + { + name: "all good", + input: &types.MsgUpdateParams{ + Authority: k.GetAuthority(), + Params: params, + }, + expErr: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + _, err := ms.UpdateParams(ctx, tc.input) + + if tc.expErr { + require.Error(t, err) + require.Contains(t, err.Error(), tc.expErrMsg) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/x/fundraising/keeper/query.go b/x/fundraising/keeper/query.go new file mode 100644 index 00000000..905f1134 --- /dev/null +++ b/x/fundraising/keeper/query.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "github.com/tendermint/fundraising/x/fundraising/types" +) + +var _ types.QueryServer = queryServer{} + +// NewQueryServerImpl returns an implementation of the QueryServer interface +// for the provided Keeper. +func NewQueryServerImpl(k Keeper) types.QueryServer { + return queryServer{k} +} + +type queryServer struct { + k Keeper +} diff --git a/x/fundraising/keeper/query_allowed_bidder.go b/x/fundraising/keeper/query_allowed_bidder.go new file mode 100644 index 00000000..4ac9a8c4 --- /dev/null +++ b/x/fundraising/keeper/query_allowed_bidder.go @@ -0,0 +1,56 @@ +package keeper + +import ( + "context" + "errors" + + "cosmossdk.io/collections" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/tendermint/fundraising/x/fundraising/types" +) + +func (q queryServer) ListAllowedBidder(ctx context.Context, req *types.QueryAllAllowedBidderRequest) (*types.QueryAllAllowedBidderResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + allowedBidders, pageRes, err := query.CollectionPaginate( + ctx, + q.k.AllowedBidder, + req.Pagination, + func(_ collections.Pair[uint64, sdk.AccAddress], value types.AllowedBidder) (types.AllowedBidder, error) { + return value, nil + }, + ) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllAllowedBidderResponse{AllowedBidder: allowedBidders, Pagination: pageRes}, nil +} + +func (q queryServer) GetAllowedBidder(ctx context.Context, req *types.QueryGetAllowedBidderRequest) (*types.QueryGetAllowedBidderResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + bidder, err := sdk.AccAddressFromBech32(req.Bidder) + if err != nil { + return nil, status.Error(codes.InvalidArgument, "invalid bidder") + } + + val, err := q.k.AllowedBidder.Get(ctx, collections.Join(req.AuctionId, bidder)) + if err != nil { + if errors.Is(err, collections.ErrNotFound) { + return nil, status.Error(codes.NotFound, "not found") + } + + return nil, status.Error(codes.Internal, "internal error") + } + + return &types.QueryGetAllowedBidderResponse{AllowedBidder: val}, nil +} diff --git a/x/fundraising/keeper/query_allowed_bidder_test.go b/x/fundraising/keeper/query_allowed_bidder_test.go new file mode 100644 index 00000000..437f5c3d --- /dev/null +++ b/x/fundraising/keeper/query_allowed_bidder_test.go @@ -0,0 +1,145 @@ +package keeper_test + +import ( + "context" + "strconv" + "testing" + + "cosmossdk.io/collections" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/tendermint/fundraising/testutil/keeper" + "github.com/tendermint/fundraising/testutil/nullify" + "github.com/tendermint/fundraising/testutil/sample" + "github.com/tendermint/fundraising/x/fundraising/keeper" + "github.com/tendermint/fundraising/x/fundraising/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createNAllowedBidder(keeper keeper.Keeper, ctx context.Context, n int) []types.AllowedBidder { + items := make([]types.AllowedBidder, n) + for i := range items { + bidder := sample.AccAddress() + items[i].AuctionId = uint64(i) + items[i].Bidder = bidder.String() + items[i].MaxBidAmount = math.ZeroInt() + + _ = keeper.AllowedBidder.Set(ctx, collections.Join(items[i].AuctionId, bidder), items[i]) + } + return items +} + +func TestAllowedBidderQuerySingle(t *testing.T) { + k, ctx, _ := keepertest.FundraisingKeeper(t) + qs := keeper.NewQueryServerImpl(k) + msgs := createNAllowedBidder(k, ctx, 2) + tests := []struct { + desc string + request *types.QueryGetAllowedBidderRequest + response *types.QueryGetAllowedBidderResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetAllowedBidderRequest{ + AuctionId: msgs[0].AuctionId, + Bidder: msgs[0].Bidder, + }, + response: &types.QueryGetAllowedBidderResponse{AllowedBidder: msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetAllowedBidderRequest{ + AuctionId: msgs[1].AuctionId, + Bidder: msgs[1].Bidder, + }, + response: &types.QueryGetAllowedBidderResponse{AllowedBidder: msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetAllowedBidderRequest{ + AuctionId: 100000, + Bidder: sample.Address(), + }, + err: status.Error(codes.NotFound, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := qs.GetAllowedBidder(ctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, tc.response, response) + } + }) + } +} + +func TestAllowedBidderQueryPaginated(t *testing.T) { + k, ctx, _ := keepertest.FundraisingKeeper(t) + qs := keeper.NewQueryServerImpl(k) + msgs := createNAllowedBidder(k, ctx, 5) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllAllowedBidderRequest { + return &types.QueryAllAllowedBidderRequest{ + AuctionId: 0, + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := qs.ListAllowedBidder(ctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.AllowedBidder), step) + require.Subset(t, + msgs, + nullify.Fill(resp.AllowedBidder), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := qs.ListAllowedBidder(ctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.AllowedBidder), step) + require.Subset(t, + msgs, + nullify.Fill(resp.AllowedBidder), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := qs.ListAllowedBidder(ctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(msgs), + nullify.Fill(resp.AllowedBidder), + ) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := qs.ListAllowedBidder(ctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/fundraising/keeper/query_auction.go b/x/fundraising/keeper/query_auction.go new file mode 100644 index 00000000..97b20279 --- /dev/null +++ b/x/fundraising/keeper/query_auction.go @@ -0,0 +1,82 @@ +package keeper + +import ( + "context" + "errors" + + "cosmossdk.io/collections" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/query" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/tendermint/fundraising/x/fundraising/types" +) + +func (q queryServer) ListAuction(ctx context.Context, req *types.QueryAllAuctionRequest) (*types.QueryAllAuctionResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + if req.Type != "" && !(req.Type == types.AuctionTypeFixedPrice.String() || req.Type == types.AuctionTypeBatch.String()) { + return nil, status.Errorf(codes.InvalidArgument, "invalid auction type %s", req.Type) + } + + if req.Status != "" && !(req.Status == types.AuctionStatusStandBy.String() || req.Status == types.AuctionStatusStarted.String() || + req.Status == types.AuctionStatusVesting.String() || req.Status == types.AuctionStatusFinished.String() || + req.Status == types.AuctionStatusCancelled.String()) { + return nil, status.Errorf(codes.InvalidArgument, "invalid auction status %s", req.Status) + } + + auctions, pageRes, err := query.CollectionFilteredPaginate( + ctx, + q.k.Auction, + req.Pagination, + func(_ uint64, auction types.AuctionI) (bool, error) { + if req.Type != "" && auction.GetType().String() != req.Type { + return false, nil + } + + if req.Status != "" && auction.GetStatus().String() != req.Status { + return false, nil + } + + return true, nil + }, + func(_ uint64, auction types.AuctionI) (*codectypes.Any, error) { + auctionAny, err := types.PackAuction(auction) + if err != nil { + return nil, err + } + return auctionAny, nil + }, + ) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllAuctionResponse{Auction: auctions, Pagination: pageRes}, nil +} + +func (q queryServer) GetAuction(ctx context.Context, req *types.QueryGetAuctionRequest) (*types.QueryGetAuctionResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + auction, err := q.k.Auction.Get(ctx, req.AuctionId) + if err != nil { + if errors.Is(err, collections.ErrNotFound) { + return nil, sdkerrors.ErrKeyNotFound + } + + return nil, status.Error(codes.Internal, "internal error") + } + + auctionAny, err := types.PackAuction(auction) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryGetAuctionResponse{Auction: auctionAny}, nil +} diff --git a/x/fundraising/keeper/query_auction_test.go b/x/fundraising/keeper/query_auction_test.go new file mode 100644 index 00000000..beac51fd --- /dev/null +++ b/x/fundraising/keeper/query_auction_test.go @@ -0,0 +1,158 @@ +package keeper_test + +import ( + "context" + "testing" + "time" + + "cosmossdk.io/math" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/tendermint/fundraising/testutil/keeper" + "github.com/tendermint/fundraising/x/fundraising/keeper" + "github.com/tendermint/fundraising/x/fundraising/types" +) + +func createNAuction(keeper keeper.Keeper, ctx context.Context, n int) ([]*codectypes.Any, error) { + var err error + items := make([]*codectypes.Any, n) + for i := range items { + iu := uint64(i) + auction := &types.FixedPriceAuction{ + BaseAuction: &types.BaseAuction{ + Id: iu, + Auctioneer: "", + StartPrice: math.LegacyMustNewDecFromStr("10"), + SellingCoin: sdk.NewCoin("coin", math.NewInt(5)), + StartTime: time.Now(), + }, + RemainingSellingCoin: sdk.NewCoin("coin", math.NewInt(1)), + } + items[i], err = types.PackAuction(auction) + if err != nil { + return nil, err + } + if err := keeper.Auction.Set(ctx, iu, auction); err != nil { + return nil, err + } + if err := keeper.AuctionSeq.Set(ctx, iu); err != nil { + return nil, err + } + } + return items, nil +} + +func auctionsToString(auctionsAny []*codectypes.Any) (auctions []string) { + for _, auction := range auctionsAny { + auctions = append(auctions, auction.String()) + } + return +} + +func TestAuctionQuerySingle(t *testing.T) { + k, ctx, _ := keepertest.FundraisingKeeper(t) + qs := keeper.NewQueryServerImpl(k) + msgs, err := createNAuction(k, ctx, 2) + require.NoError(t, err) + + tests := []struct { + desc string + request *types.QueryGetAuctionRequest + response *types.QueryGetAuctionResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetAuctionRequest{AuctionId: 0}, + response: &types.QueryGetAuctionResponse{Auction: msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetAuctionRequest{AuctionId: 1}, + response: &types.QueryGetAuctionResponse{Auction: msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetAuctionRequest{AuctionId: uint64(len(msgs))}, + err: sdkerrors.ErrKeyNotFound, + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := qs.GetAuction(ctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, tc.response.String(), response.String()) + } + }) + } +} + +func TestAuctionQueryPaginated(t *testing.T) { + k, ctx, _ := keepertest.FundraisingKeeper(t) + qs := keeper.NewQueryServerImpl(k) + msgs, err := createNAuction(k, ctx, 5) + require.NoError(t, err) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllAuctionRequest { + return &types.QueryAllAuctionRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := qs.ListAuction(ctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.Auction), step) + require.Subset(t, + auctionsToString(msgs), + auctionsToString(resp.Auction), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := qs.ListAuction(ctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.Auction), step) + require.Subset(t, + auctionsToString(msgs), + auctionsToString(resp.Auction), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := qs.ListAuction(ctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + auctionsToString(msgs), + auctionsToString(resp.Auction), + ) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := qs.ListAuction(ctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/fundraising/keeper/query_bid.go b/x/fundraising/keeper/query_bid.go new file mode 100644 index 00000000..6ee99919 --- /dev/null +++ b/x/fundraising/keeper/query_bid.go @@ -0,0 +1,51 @@ +package keeper + +import ( + "context" + "errors" + + "cosmossdk.io/collections" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/query" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/tendermint/fundraising/x/fundraising/types" +) + +func (q queryServer) ListBid(ctx context.Context, req *types.QueryAllBidRequest) (*types.QueryAllBidResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + bids, pageRes, err := query.CollectionPaginate( + ctx, + q.k.Bid, + req.Pagination, + func(_ collections.Pair[uint64, uint64], value types.Bid) (types.Bid, error) { + return value, nil + }, + ) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllBidResponse{Bid: bids, Pagination: pageRes}, nil +} + +func (q queryServer) GetBid(ctx context.Context, req *types.QueryGetBidRequest) (*types.QueryGetBidResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + bid, err := q.k.Bid.Get(ctx, collections.Join(req.AuctionId, req.BidId)) + if err != nil { + if errors.Is(err, collections.ErrNotFound) { + return nil, sdkerrors.ErrKeyNotFound + } + + return nil, status.Error(codes.Internal, "internal error") + } + + return &types.QueryGetBidResponse{Bid: bid}, nil +} diff --git a/x/fundraising/keeper/query_bid_test.go b/x/fundraising/keeper/query_bid_test.go new file mode 100644 index 00000000..a64cc8dd --- /dev/null +++ b/x/fundraising/keeper/query_bid_test.go @@ -0,0 +1,139 @@ +package keeper_test + +import ( + "context" + "testing" + + "cosmossdk.io/collections" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/tendermint/fundraising/testutil/keeper" + "github.com/tendermint/fundraising/testutil/nullify" + "github.com/tendermint/fundraising/testutil/sample" + "github.com/tendermint/fundraising/x/fundraising/keeper" + "github.com/tendermint/fundraising/x/fundraising/types" +) + +func createNBid(keeper keeper.Keeper, ctx context.Context, n int) ([]types.Bid, error) { + items := make([]types.Bid, n) + auctionId := uint64(0) + for i := range items { + bidid := uint64(i) + items[i].AuctionId = auctionId + items[i].Id = bidid + items[i].Bidder = sample.Address() + items[i].Coin = sdk.NewCoin("coin", math.NewInt(int64(i))) + items[i].Price = math.LegacyNewDec(int64(i)) + items[i].Type = types.BidTypeFixedPrice + + if err := keeper.Bid.Set(ctx, collections.Join(auctionId, bidid), items[i]); err != nil { + return nil, err + } + if err := keeper.BidSeq.Set(ctx, auctionId, items[i].Id); err != nil { + return nil, err + } + } + return items, nil +} + +func TestBidQuerySingle(t *testing.T) { + k, ctx, _ := keepertest.FundraisingKeeper(t) + qs := keeper.NewQueryServerImpl(k) + msgs, err := createNBid(k, ctx, 2) + require.NoError(t, err) + + tests := []struct { + desc string + request *types.QueryGetBidRequest + response *types.QueryGetBidResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetBidRequest{AuctionId: 0, BidId: msgs[0].Id}, + response: &types.QueryGetBidResponse{Bid: msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetBidRequest{AuctionId: 0, BidId: msgs[1].Id}, + response: &types.QueryGetBidResponse{Bid: msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetBidRequest{AuctionId: 0, BidId: uint64(len(msgs))}, + err: sdkerrors.ErrKeyNotFound, + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := qs.GetBid(ctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} + +func TestBidQueryPaginated(t *testing.T) { + k, ctx, _ := keepertest.FundraisingKeeper(t) + qs := keeper.NewQueryServerImpl(k) + msgs, err := createNBid(k, ctx, 5) + require.NoError(t, err) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllBidRequest { + return &types.QueryAllBidRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := qs.ListBid(ctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.Bid), step) + require.Subset(t, msgs, resp.Bid) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := qs.ListBid(ctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.Bid), step) + require.Subset(t, msgs, resp.Bid) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := qs.ListBid(ctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + require.ElementsMatch(t, msgs, resp.Bid) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := qs.ListBid(ctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/fundraising/keeper/query_params.go b/x/fundraising/keeper/query_params.go new file mode 100644 index 00000000..ff3d66dd --- /dev/null +++ b/x/fundraising/keeper/query_params.go @@ -0,0 +1,30 @@ +package keeper + +import ( + "context" + "errors" + + "cosmossdk.io/collections" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/tendermint/fundraising/x/fundraising/types" +) + +func (q queryServer) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + params, err := q.k.Params.Get(ctx) + if err != nil { + if errors.Is(err, collections.ErrNotFound) { + return nil, status.Error(codes.NotFound, "not found") + } + + return nil, status.Error(codes.Internal, "internal error") + } + + return &types.QueryParamsResponse{Params: params}, nil +} diff --git a/x/fundraising/keeper/query_params_test.go b/x/fundraising/keeper/query_params_test.go new file mode 100644 index 00000000..db9379ef --- /dev/null +++ b/x/fundraising/keeper/query_params_test.go @@ -0,0 +1,33 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + keepertest "github.com/tendermint/fundraising/testutil/keeper" + "github.com/tendermint/fundraising/x/fundraising/keeper" + "github.com/tendermint/fundraising/x/fundraising/types" +) + +func TestParamsQuery(t *testing.T) { + k, ctx, _ := keepertest.FundraisingKeeper(t) + + qs := keeper.NewQueryServerImpl(k) + params := types.DefaultParams() + require.NoError(t, k.Params.Set(ctx, params)) + + response, err := qs.Params(ctx, &types.QueryParamsRequest{}) + require.NoError(t, err) + + // Prevents from nil slice + if len(response.Params.AuctionCreationFee) == 0 { + response.Params.AuctionCreationFee = sdk.Coins{} + } + if len(response.Params.PlaceBidFee) == 0 { + response.Params.PlaceBidFee = sdk.Coins{} + } + + require.Equal(t, &types.QueryParamsResponse{Params: params}, response) +} diff --git a/x/fundraising/keeper/query_vesting_queue.go b/x/fundraising/keeper/query_vesting_queue.go new file mode 100644 index 00000000..04f145cd --- /dev/null +++ b/x/fundraising/keeper/query_vesting_queue.go @@ -0,0 +1,33 @@ +package keeper + +import ( + "context" + "time" + + "cosmossdk.io/collections" + "github.com/cosmos/cosmos-sdk/types/query" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/tendermint/fundraising/x/fundraising/types" +) + +func (q queryServer) ListVestingQueue(ctx context.Context, req *types.QueryAllVestingQueueRequest) (*types.QueryAllVestingQueueResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + vestingQueues, pageRes, err := query.CollectionPaginate( + ctx, + q.k.VestingQueue, + req.Pagination, + func(_ collections.Pair[uint64, time.Time], value types.VestingQueue) (types.VestingQueue, error) { + return value, nil + }, + ) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllVestingQueueResponse{VestingQueue: vestingQueues, Pagination: pageRes}, nil +} diff --git a/x/fundraising/keeper/query_vesting_queue_test.go b/x/fundraising/keeper/query_vesting_queue_test.go new file mode 100644 index 00000000..1011e08f --- /dev/null +++ b/x/fundraising/keeper/query_vesting_queue_test.go @@ -0,0 +1,94 @@ +package keeper_test + +import ( + "context" + "strconv" + "testing" + "time" + + "cosmossdk.io/collections" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/tendermint/fundraising/testutil/keeper" + "github.com/tendermint/fundraising/testutil/nullify" + "github.com/tendermint/fundraising/testutil/sample" + "github.com/tendermint/fundraising/x/fundraising/keeper" + "github.com/tendermint/fundraising/x/fundraising/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createNVestingQueue(keeper keeper.Keeper, ctx context.Context, n int) []types.VestingQueue { + items := make([]types.VestingQueue, n) + for i := range items { + items[i].AuctionId = uint64(i) + items[i].ReleaseTime = time.Now().UTC() + items[i].PayingCoin = sdk.NewCoin("coin", math.NewInt(int64(i))) + items[i].Auctioneer = sample.Address() + + _ = keeper.VestingQueue.Set(ctx, collections.Join(items[i].AuctionId, items[i].ReleaseTime), items[i]) + } + return items +} + +func TestVestingQueueQueryPaginated(t *testing.T) { + k, ctx, _ := keepertest.FundraisingKeeper(t) + qs := keeper.NewQueryServerImpl(k) + msgs := createNVestingQueue(k, ctx, 5) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllVestingQueueRequest { + return &types.QueryAllVestingQueueRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := qs.ListVestingQueue(ctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.VestingQueue), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.VestingQueue), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := qs.ListVestingQueue(ctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.VestingQueue), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.VestingQueue), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := qs.ListVestingQueue(ctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(msgs), + nullify.Fill(resp.VestingQueue), + ) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := qs.ListVestingQueue(ctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/fundraising/keeper/store.go b/x/fundraising/keeper/store.go deleted file mode 100644 index 12fa6467..00000000 --- a/x/fundraising/keeper/store.go +++ /dev/null @@ -1,338 +0,0 @@ -package keeper - -import ( - "time" - - gogotypes "github.com/gogo/protobuf/types" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/tendermint/fundraising/x/fundraising/types" -) - -// GetLastAuctionId returns the last auction id. -func (k Keeper) GetLastAuctionId(ctx sdk.Context) uint64 { - var id uint64 - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.LastAuctionIdKey) - if bz == nil { - id = 0 // initialize the auction id - } else { - val := gogotypes.UInt64Value{} - k.cdc.MustUnmarshal(bz, &val) - id = val.GetValue() - } - return id -} - -// SetAuctionId stores the last auction id. -func (k Keeper) SetAuctionId(ctx sdk.Context, id uint64) { - store := ctx.KVStore(k.storeKey) - bz := k.cdc.MustMarshal(&gogotypes.UInt64Value{Value: id}) - store.Set(types.LastAuctionIdKey, bz) -} - -// GetAuction returns an auction interface from the given auction id. -func (k Keeper) GetAuction(ctx sdk.Context, id uint64) (auction types.AuctionI, found bool) { - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.GetAuctionKey(id)) - if bz == nil { - return auction, false - } - - auction = types.MustUnmarshalAuction(k.cdc, bz) - - return auction, true -} - -// SetAuction sets an auction with the given auction id. -func (k Keeper) SetAuction(ctx sdk.Context, auction types.AuctionI) { - store := ctx.KVStore(k.storeKey) - bz := types.MustMarshalAuction(k.cdc, auction) - store.Set(types.GetAuctionKey(auction.GetId()), bz) -} - -// GetAuctions returns all auctions in the store. -func (k Keeper) GetAuctions(ctx sdk.Context) (auctions []types.AuctionI) { - k.IterateAuctions(ctx, func(auction types.AuctionI) (stop bool) { - auctions = append(auctions, auction) - return false - }) - return auctions -} - -// IterateAuctions iterates over all the stored auctions and performs a callback function. -// Stops iteration when callback returns true. -func (k Keeper) IterateAuctions(ctx sdk.Context, cb func(auction types.AuctionI) (stop bool)) { - store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.AuctionKeyPrefix) - - defer iterator.Close() - for ; iterator.Valid(); iterator.Next() { - auction := types.MustUnmarshalAuction(k.cdc, iterator.Value()) - - if cb(auction) { - break - } - } -} - -// GetAllowedBidder returns an allowed bidder object for the given auction id and bidder address. -func (k Keeper) GetAllowedBidder(ctx sdk.Context, auctionId uint64, bidderAddr sdk.AccAddress) (allowedBidder types.AllowedBidder, found bool) { - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.GetAllowedBidderKey(auctionId, bidderAddr)) - if bz == nil { - return - } - k.cdc.MustUnmarshal(bz, &allowedBidder) - found = true - return -} - -// SetAllowedBidder stores an allowed bidder object for the auction. -func (k Keeper) SetAllowedBidder(ctx sdk.Context, auctionId uint64, allowedBidder types.AllowedBidder) { - store := ctx.KVStore(k.storeKey) - bz := k.cdc.MustMarshal(&allowedBidder) - store.Set(types.GetAllowedBidderKey(auctionId, allowedBidder.GetBidder()), bz) -} - -// GetAllowedBiddersByAuction returns allowed bidders list for the auction. -func (k Keeper) GetAllowedBiddersByAuction(ctx sdk.Context, auctionId uint64) (allowedBidders []types.AllowedBidder) { - _ = k.IterateAllowedBiddersByAuction(ctx, auctionId, func(allowedBidder types.AllowedBidder) (stop bool, err error) { - allowedBidders = append(allowedBidders, allowedBidder) - return false, nil - }) - return -} - -// IterateAllowedBiddersByAuction iterates through all the allowed bidder for the auction -// and call cb for each allowed bidder. -func (k Keeper) IterateAllowedBiddersByAuction(ctx sdk.Context, auctionId uint64, cb func(ab types.AllowedBidder) (stop bool, err error)) error { - store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.GetAllowedBiddersByAuctionKeyPrefix(auctionId)) - defer iter.Close() - for ; iter.Valid(); iter.Next() { - var allowedBidder types.AllowedBidder - k.cdc.MustUnmarshal(iter.Value(), &allowedBidder) - stop, err := cb(allowedBidder) - if err != nil { - return err - } - if stop { - break - } - } - return nil -} - -// GetLastBidId returns the last bid id for the bid. -func (k Keeper) GetLastBidId(ctx sdk.Context, auctionId uint64) uint64 { - var id uint64 - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.GetLastBidIdKey(auctionId)) - if bz == nil { - id = 0 // initialize the bid id - } else { - val := gogotypes.UInt64Value{} - k.cdc.MustUnmarshal(bz, &val) - id = val.GetValue() - } - return id -} - -// SetBidId sets the bid id for the auction. -func (k Keeper) SetBidId(ctx sdk.Context, auctionId uint64, bidId uint64) { - store := ctx.KVStore(k.storeKey) - bz := k.cdc.MustMarshal(&gogotypes.UInt64Value{Value: bidId}) - store.Set(types.GetLastBidIdKey(auctionId), bz) -} - -// GetBid returns a bid for the given auction id and bid id. -// A bidder can have as many bids as they want, so bid id is required to get the bid. -func (k Keeper) GetBid(ctx sdk.Context, auctionId uint64, bidId uint64) (bid types.Bid, found bool) { - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.GetBidKey(auctionId, bidId)) - if bz == nil { - return bid, false - } - k.cdc.MustUnmarshal(bz, &bid) - return bid, true -} - -// SetBid sets a bid with the given arguments. -func (k Keeper) SetBid(ctx sdk.Context, bid types.Bid) { - store := ctx.KVStore(k.storeKey) - bz := k.cdc.MustMarshal(&bid) - store.Set(types.GetBidKey(bid.AuctionId, bid.Id), bz) - store.Set(types.GetBidIndexKey(bid.GetBidder(), bid.AuctionId, bid.Id), []byte{}) -} - -// GetBids returns all bids registered in the store. -func (k Keeper) GetBids(ctx sdk.Context) []types.Bid { - bids := []types.Bid{} - k.IterateBids(ctx, func(bid types.Bid) (stop bool) { - bids = append(bids, bid) - return false - }) - return bids -} - -// GetBidsByAuctionId returns all bids associated with the auction id that are registered in the store. -func (k Keeper) GetBidsByAuctionId(ctx sdk.Context, auctionId uint64) []types.Bid { - bids := []types.Bid{} - k.IterateBidsByAuctionId(ctx, auctionId, func(bid types.Bid) (stop bool) { - bids = append(bids, bid) - return false - }) - return bids -} - -// GetBidsByBidder returns all bids associated with the bidder that are registered in the store. -func (k Keeper) GetBidsByBidder(ctx sdk.Context, bidderAddr sdk.AccAddress) []types.Bid { - bids := []types.Bid{} - k.IterateBidsByBidder(ctx, bidderAddr, func(bid types.Bid) (stop bool) { - bids = append(bids, bid) - return false - }) - return bids -} - -// IterateBids iterates through all bids stored in the store and invokes callback function for each item. -// Stops the iteration when the callback function returns true. -func (k Keeper) IterateBids(ctx sdk.Context, cb func(bid types.Bid) (stop bool)) { - store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.BidKeyPrefix) - defer iter.Close() - for ; iter.Valid(); iter.Next() { - var bid types.Bid - k.cdc.MustUnmarshal(iter.Value(), &bid) - if cb(bid) { - break - } - } -} - -// IterateBidsByAuctionId iterates through all bids associated with the auction id stored in the store -// and invokes callback function for each item. -// Stops the iteration when the callback function returns true. -func (k Keeper) IterateBidsByAuctionId(ctx sdk.Context, auctionId uint64, cb func(bid types.Bid) (stop bool)) { - store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.GetBidByAuctionIdPrefix(auctionId)) - defer iter.Close() - for ; iter.Valid(); iter.Next() { - var bid types.Bid - k.cdc.MustUnmarshal(iter.Value(), &bid) - if cb(bid) { - break - } - } -} - -// IterateBidsByBidder iterates through all bids associated with the bidder stored in the store -// and invokes callback function for each item. -// Stops the iteration when the callback function returns true. -func (k Keeper) IterateBidsByBidder(ctx sdk.Context, bidderAddr sdk.AccAddress, cb func(bid types.Bid) (stop bool)) { - store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.GetBidIndexByBidderPrefix(bidderAddr)) - defer iter.Close() - for ; iter.Valid(); iter.Next() { - auctionId, bidId := types.ParseBidIndexKey(iter.Key()) - bid, _ := k.GetBid(ctx, auctionId, bidId) - if cb(bid) { - break - } - } -} - -func (k Keeper) GetLastMatchedBidsLen(ctx sdk.Context, auctionId uint64) int64 { - var len int64 - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.GetLastMatchedBidsLenKey(auctionId)) - if bz == nil { - len = 0 // initialize the auction id - } else { - val := gogotypes.Int64Value{} - k.cdc.MustUnmarshal(bz, &val) - len = val.GetValue() - } - return len -} - -func (k Keeper) SetMatchedBidsLen(ctx sdk.Context, auctionId uint64, matchedLen int64) { - store := ctx.KVStore(k.storeKey) - bz := k.cdc.MustMarshal(&gogotypes.Int64Value{Value: matchedLen}) - store.Set(types.GetLastMatchedBidsLenKey(auctionId), bz) -} - -// GetVestingQueue returns a slice of vesting queues that the auction is complete and -// waiting in a queue to release the vesting amount of coin at the respective release time. -func (k Keeper) GetVestingQueue(ctx sdk.Context, auctionId uint64, releaseTime time.Time) types.VestingQueue { - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.GetVestingQueueKey(auctionId, releaseTime)) - if bz == nil { - return types.VestingQueue{} - } - - queue := types.VestingQueue{} - k.cdc.MustUnmarshal(bz, &queue) - - return queue -} - -// SetVestingQueue sets vesting queue into with the given release time and auction id. -func (k Keeper) SetVestingQueue(ctx sdk.Context, queue types.VestingQueue) { - store := ctx.KVStore(k.storeKey) - bz := k.cdc.MustMarshal(&queue) - store.Set(types.GetVestingQueueKey(queue.AuctionId, queue.ReleaseTime), bz) -} - -// GetVestingQueues returns all vesting queues registered in the store. -func (k Keeper) GetVestingQueues(ctx sdk.Context) []types.VestingQueue { - queues := []types.VestingQueue{} - k.IterateVestingQueues(ctx, func(queue types.VestingQueue) (stop bool) { - queues = append(queues, queue) - return false - }) - return queues -} - -// GetVestingQueuesByAuctionId returns all vesting queues associated with the auction id that are registered in the store. -func (k Keeper) GetVestingQueuesByAuctionId(ctx sdk.Context, auctionId uint64) []types.VestingQueue { - queues := []types.VestingQueue{} - k.IterateVestingQueuesByAuctionId(ctx, auctionId, func(queue types.VestingQueue) (stop bool) { - queues = append(queues, queue) - return false - }) - return queues -} - -// IterateVestingQueues iterates through all VestingQueues and invokes callback function for each item. -// Stops the iteration when the callback function returns true. -func (k Keeper) IterateVestingQueues(ctx sdk.Context, cb func(queue types.VestingQueue) (stop bool)) { - store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.VestingQueueKeyPrefix) - defer iter.Close() - for ; iter.Valid(); iter.Next() { - var queue types.VestingQueue - k.cdc.MustUnmarshal(iter.Value(), &queue) - if cb(queue) { - break - } - } -} - -// IterateVestingQueuesByAuctionId iterates through all VestingQueues associated with the auction id stored in the store -// and invokes callback function for each item. -// Stops the iteration when the callback function returns true. -func (k Keeper) IterateVestingQueuesByAuctionId(ctx sdk.Context, auctionId uint64, cb func(queue types.VestingQueue) (stop bool)) { - store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.GetVestingQueueByAuctionIdPrefix(auctionId)) - defer iter.Close() - for ; iter.Valid(); iter.Next() { - var queue types.VestingQueue - k.cdc.MustUnmarshal(iter.Value(), &queue) - if cb(queue) { - break - } - } -} diff --git a/x/fundraising/keeper/store_test.go b/x/fundraising/keeper/store_test.go index bd9cb4ce..fba1f9a5 100644 --- a/x/fundraising/keeper/store_test.go +++ b/x/fundraising/keeper/store_test.go @@ -3,24 +3,32 @@ package keeper_test import ( "time" + "cosmossdk.io/collections" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + _ "github.com/stretchr/testify/suite" "github.com/tendermint/fundraising/x/fundraising/types" - - _ "github.com/stretchr/testify/suite" ) func (s *KeeperTestSuite) TestLastAuctionId() { - auctionId := s.keeper.GetLastAuctionId(s.ctx) + cacheCtx, _ := s.ctx.CacheContext() + + auctionId, err := s.keeper.AuctionSeq.Peek(cacheCtx) + s.Require().NoError(err) s.Require().Equal(uint64(0), auctionId) - cacheCtx, _ := s.ctx.CacheContext() - nextAuctionId := s.keeper.GetNextAuctionIdWithUpdate(cacheCtx) + nextAuctionId, err := s.keeper.AuctionSeq.Next(cacheCtx) + s.Require().NoError(err) + s.Require().Equal(uint64(0), nextAuctionId) + + nextAuctionId, err = s.keeper.AuctionSeq.Next(cacheCtx) + s.Require().NoError(err) s.Require().Equal(uint64(1), nextAuctionId) s.createFixedPriceAuction( s.addr(0), - sdk.MustNewDecFromStr("1.0"), + math.LegacyMustNewDecFromStr("1.0"), parseCoin("1000000000denom1"), "denom2", []types.VestingSchedule{}, @@ -28,15 +36,17 @@ func (s *KeeperTestSuite) TestLastAuctionId() { time.Now().AddDate(0, 6, 0).AddDate(0, 1, 0), true, ) - nextAuctionId = s.keeper.GetNextAuctionIdWithUpdate(cacheCtx) + nextAuctionId, err = s.keeper.AuctionSeq.Next(cacheCtx) + s.Require().NoError(err) s.Require().Equal(uint64(2), nextAuctionId) - auctions := s.keeper.GetAuctions(s.ctx) + auctions, err := s.keeper.Auctions(s.ctx) + s.Require().NoError(err) s.Require().Len(auctions, 1) s.createFixedPriceAuction( s.addr(1), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), parseCoin("5000000000denom3"), "denom4", []types.VestingSchedule{}, @@ -44,17 +54,19 @@ func (s *KeeperTestSuite) TestLastAuctionId() { time.Now().AddDate(0, 6, 0).AddDate(0, 1, 0), true, ) - nextAuctionId = s.keeper.GetNextAuctionIdWithUpdate(cacheCtx) + nextAuctionId, err = s.keeper.AuctionSeq.Next(cacheCtx) + s.Require().NoError(err) s.Require().Equal(uint64(3), nextAuctionId) - auctions = s.keeper.GetAuctions(s.ctx) + auctions, err = s.keeper.Auctions(s.ctx) + s.Require().NoError(err) s.Require().Len(auctions, 2) } func (s *KeeperTestSuite) TestAllowedBidderByAuction() { auction := s.createFixedPriceAuction( s.addr(0), - sdk.MustNewDecFromStr("1.0"), + math.LegacyMustNewDecFromStr("1.0"), parseCoin("1000000000denom1"), "denom2", []types.VestingSchedule{}, @@ -64,26 +76,28 @@ func (s *KeeperTestSuite) TestAllowedBidderByAuction() { ) s.Require().Equal(auction.GetStatus(), types.AuctionStatusStandBy) - allowedBidders := s.keeper.GetAllowedBiddersByAuction(s.ctx, auction.Id) + allowedBidders, err := s.keeper.GetAllowedBiddersByAuction(s.ctx, auction.Id) + s.Require().NoError(err) s.Require().Len(allowedBidders, 0) // Add new allowed bidders newAllowedBidders := []types.AllowedBidder{ - {Bidder: s.addr(1).String(), MaxBidAmount: parseInt("100000")}, - {Bidder: s.addr(2).String(), MaxBidAmount: parseInt("100000")}, - {Bidder: s.addr(3).String(), MaxBidAmount: parseInt("100000")}, + {AuctionId: 1, Bidder: s.addr(1).String(), MaxBidAmount: parseInt("100000")}, + {AuctionId: 1, Bidder: s.addr(2).String(), MaxBidAmount: parseInt("100000")}, + {AuctionId: 1, Bidder: s.addr(3).String(), MaxBidAmount: parseInt("100000")}, } - err := s.keeper.AddAllowedBidders(s.ctx, auction.Id, newAllowedBidders) + err = s.keeper.AddAllowedBidders(s.ctx, auction.Id, newAllowedBidders) s.Require().NoError(err) - allowedBidders = s.keeper.GetAllowedBiddersByAuction(s.ctx, auction.Id) + allowedBidders, err = s.keeper.GetAllowedBiddersByAuction(s.ctx, auction.Id) + s.Require().NoError(err) s.Require().Len(allowedBidders, 3) } func (s *KeeperTestSuite) TestLastBidId() { auction := s.createFixedPriceAuction( s.addr(0), - sdk.OneDec(), + math.LegacyOneDec(), parseCoin("500000000000denom1"), "denom2", []types.VestingSchedule{}, @@ -93,23 +107,26 @@ func (s *KeeperTestSuite) TestLastBidId() { ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - bidId := s.keeper.GetLastBidId(s.ctx, auction.Id) + bidId, err := s.keeper.BidSeq.Get(s.ctx, auction.Id) + s.Require().Error(err) s.Require().Equal(uint64(0), bidId) - s.placeBidFixedPrice(auction.Id, s.addr(1), sdk.OneDec(), parseCoin("20000000denom2"), true) - s.placeBidFixedPrice(auction.Id, s.addr(2), sdk.OneDec(), parseCoin("20000000denom2"), true) - s.placeBidFixedPrice(auction.Id, s.addr(3), sdk.OneDec(), parseCoin("15000000denom2"), true) + s.placeBidFixedPrice(auction.Id, s.addr(1), math.LegacyOneDec(), parseCoin("20000000denom2"), true) + s.placeBidFixedPrice(auction.Id, s.addr(2), math.LegacyOneDec(), parseCoin("20000000denom2"), true) + s.placeBidFixedPrice(auction.Id, s.addr(3), math.LegacyOneDec(), parseCoin("15000000denom2"), true) - bidsById := s.keeper.GetBidsByAuctionId(s.ctx, auction.GetId()) + bidsById, err := s.keeper.GetBidsByAuctionId(s.ctx, auction.GetId()) + s.Require().NoError(err) s.Require().Len(bidsById, 3) - nextId := s.keeper.GetNextBidIdWithUpdate(s.ctx, auction.GetId()) + nextId, err := s.keeper.GetNextBidIdWithUpdate(s.ctx, auction.GetId()) + s.Require().NoError(err) s.Require().Equal(uint64(4), nextId) // Create another auction auction2 := s.createFixedPriceAuction( s.addr(0), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), parseCoin("1000000000000denom3"), "denom4", []types.VestingSchedule{}, @@ -119,17 +136,19 @@ func (s *KeeperTestSuite) TestLastBidId() { ) // Bid id must start from 1 with new auction - bidsById = s.keeper.GetBidsByAuctionId(s.ctx, auction2.GetId()) + bidsById, err = s.keeper.GetBidsByAuctionId(s.ctx, auction2.GetId()) + s.Require().NoError(err) s.Require().Len(bidsById, 0) - nextId = s.keeper.GetNextBidIdWithUpdate(s.ctx, auction2.GetId()) + nextId, err = s.keeper.GetNextBidIdWithUpdate(s.ctx, auction2.GetId()) + s.Require().NoError(err) s.Require().Equal(uint64(1), nextId) } func (s *KeeperTestSuite) TestIterateBids() { startedAuction := s.createFixedPriceAuction( s.addr(0), - sdk.OneDec(), + math.LegacyOneDec(), parseCoin("500000000000denom1"), "denom2", []types.VestingSchedule{}, @@ -138,22 +157,25 @@ func (s *KeeperTestSuite) TestIterateBids() { true, ) - auction, found := s.keeper.GetAuction(s.ctx, startedAuction.GetId()) - s.Require().True(found) + auction, err := s.keeper.Auction.Get(s.ctx, startedAuction.GetId()) + s.Require().NoError(err) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) - s.placeBidFixedPrice(auction.GetId(), s.addr(1), sdk.OneDec(), parseCoin("20000000denom2"), true) - s.placeBidFixedPrice(auction.GetId(), s.addr(2), sdk.OneDec(), parseCoin("20000000denom2"), true) - s.placeBidFixedPrice(auction.GetId(), s.addr(2), sdk.OneDec(), parseCoin("15000000denom2"), true) - s.placeBidFixedPrice(auction.GetId(), s.addr(3), sdk.OneDec(), parseCoin("35000000denom2"), true) + s.placeBidFixedPrice(auction.GetId(), s.addr(1), math.LegacyOneDec(), parseCoin("20000000denom2"), true) + s.placeBidFixedPrice(auction.GetId(), s.addr(2), math.LegacyOneDec(), parseCoin("20000000denom2"), true) + s.placeBidFixedPrice(auction.GetId(), s.addr(2), math.LegacyOneDec(), parseCoin("15000000denom2"), true) + s.placeBidFixedPrice(auction.GetId(), s.addr(3), math.LegacyOneDec(), parseCoin("35000000denom2"), true) - bids := s.keeper.GetBids(s.ctx) + bids, err := s.keeper.Bids(s.ctx) + s.Require().NoError(err) s.Require().Len(bids, 4) - bidsById := s.keeper.GetBidsByAuctionId(s.ctx, auction.GetId()) + bidsById, err := s.keeper.GetBidsByAuctionId(s.ctx, auction.GetId()) + s.Require().NoError(err) s.Require().Len(bidsById, 4) - bidsByBidder := s.keeper.GetBidsByBidder(s.ctx, s.addr(2)) + bidsByBidder, err := s.keeper.GetBidsByBidder(s.ctx, s.addr(2)) + s.Require().NoError(err) s.Require().Len(bidsByBidder, 2) } @@ -165,9 +187,18 @@ func (s *KeeperTestSuite) TestVestingQueue() { types.MustParseRFC3339("2023-01-01T00:00:00Z"), false, ) - s.keeper.SetVestingQueue(s.ctx, vestingQueue) + err := s.keeper.VestingQueue.Set( + s.ctx, + collections.Join( + vestingQueue.AuctionId, + vestingQueue.ReleaseTime, + ), + vestingQueue, + ) + s.Require().NoError(err) - vq := s.keeper.GetVestingQueue(s.ctx, 1, vestingQueue.ReleaseTime) + vq, err := s.keeper.VestingQueue.Get(s.ctx, collections.Join(vestingQueue.AuctionId, vestingQueue.ReleaseTime)) + s.Require().NoError(err) s.Require().EqualValues(vestingQueue, vq) } @@ -180,60 +211,86 @@ func (s *KeeperTestSuite) TestVestingQueueIterator() { for _, vs := range []types.VestingSchedule{ { ReleaseTime: types.MustParseRFC3339("2023-01-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.5"), + Weight: math.LegacyMustNewDecFromStr("0.5"), }, { ReleaseTime: types.MustParseRFC3339("2023-06-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.5"), + Weight: math.LegacyMustNewDecFromStr("0.5"), }, } { - payingAmt := sdk.NewDecFromInt(reserveCoin.Amount).MulTruncate(vs.Weight).TruncateInt() + payingAmt := math.LegacyNewDecFromInt(reserveCoin.Amount).MulTruncate(vs.Weight).TruncateInt() - s.keeper.SetVestingQueue(s.ctx, types.VestingQueue{ + vestingQueue := types.VestingQueue{ AuctionId: uint64(1), Auctioneer: s.addr(1).String(), PayingCoin: sdk.NewCoin(payingCoinDenom, payingAmt), ReleaseTime: vs.ReleaseTime, Released: false, - }) + } + err := s.keeper.VestingQueue.Set( + s.ctx, + collections.Join( + vestingQueue.AuctionId, + vestingQueue.ReleaseTime, + ), + vestingQueue, + ) + s.Require().NoError(err) } // Set vesting schedules with 4 vesting queues for _, vs := range []types.VestingSchedule{ { ReleaseTime: types.MustParseRFC3339("2023-01-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.25"), + Weight: math.LegacyMustNewDecFromStr("0.25"), }, { ReleaseTime: types.MustParseRFC3339("2023-05-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.25"), + Weight: math.LegacyMustNewDecFromStr("0.25"), }, { ReleaseTime: types.MustParseRFC3339("2023-09-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.25"), + Weight: math.LegacyMustNewDecFromStr("0.25"), }, { ReleaseTime: types.MustParseRFC3339("2023-12-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.25"), + Weight: math.LegacyMustNewDecFromStr("0.25"), }, } { - payingAmt := sdk.NewDecFromInt(reserveCoin.Amount).MulTruncate(vs.Weight).TruncateInt() + payingAmt := math.LegacyNewDecFromInt(reserveCoin.Amount).MulTruncate(vs.Weight).TruncateInt() - s.keeper.SetVestingQueue(s.ctx, types.VestingQueue{ + vestingQueue := types.VestingQueue{ AuctionId: uint64(2), Auctioneer: s.addr(2).String(), PayingCoin: sdk.NewCoin(payingCoinDenom, payingAmt), ReleaseTime: vs.ReleaseTime, Released: false, - }) + } + err := s.keeper.VestingQueue.Set( + s.ctx, + collections.Join( + vestingQueue.AuctionId, + vestingQueue.ReleaseTime, + ), + vestingQueue, + ) + s.Require().NoError(err) } - s.Require().Len(s.keeper.GetVestingQueuesByAuctionId(s.ctx, uint64(1)), 2) - s.Require().Len(s.keeper.GetVestingQueuesByAuctionId(s.ctx, uint64(2)), 4) - s.Require().Len(s.keeper.GetVestingQueues(s.ctx), 6) + vq1, err := s.keeper.GetVestingQueuesByAuctionId(s.ctx, uint64(1)) + s.Require().NoError(err) + s.Require().Len(vq1, 2) + + vq2, err := s.keeper.GetVestingQueuesByAuctionId(s.ctx, uint64(2)) + s.Require().NoError(err) + s.Require().Len(vq2, 4) + + vqs, err := s.keeper.VestingQueues(s.ctx) + s.Require().NoError(err) + s.Require().Len(vqs, 6) totalPayingCoin := sdk.NewInt64Coin(payingCoinDenom, 0) - for _, vq := range s.keeper.GetVestingQueuesByAuctionId(s.ctx, uint64(2)) { + for _, vq := range vq2 { totalPayingCoin = totalPayingCoin.Add(vq.PayingCoin) } s.Require().Equal(reserveCoin, totalPayingCoin) diff --git a/x/fundraising/keeper/vesting.go b/x/fundraising/keeper/vesting.go index 99026b29..d21bb441 100644 --- a/x/fundraising/keeper/vesting.go +++ b/x/fundraising/keeper/vesting.go @@ -1,14 +1,49 @@ package keeper import ( + "context" + "time" + + "cosmossdk.io/collections" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/tendermint/fundraising/x/fundraising/types" ) +// VestingQueues returns all VestingQueue. +func (k Keeper) VestingQueues(ctx context.Context) ([]types.VestingQueue, error) { + vestingQueues := make([]types.VestingQueue, 0) + err := k.IterateVestingQueues(ctx, func(_ collections.Pair[uint64, time.Time], bid types.VestingQueue) (bool, error) { + vestingQueues = append(vestingQueues, bid) + return false, nil + }) + return vestingQueues, err +} + +// IterateVestingQueues iterates over all the VestingQueues and performs a callback function. +func (k Keeper) IterateVestingQueues(ctx context.Context, cb func(collections.Pair[uint64, time.Time], types.VestingQueue) (bool, error)) error { + err := k.VestingQueue.Walk(ctx, nil, cb) + if err != nil { + return err + } + return nil +} + +// GetVestingQueuesByAuctionId returns all vesting queues associated with the auction id that are registered in the store. +func (k Keeper) GetVestingQueuesByAuctionId(ctx context.Context, auctionId uint64) ([]types.VestingQueue, error) { + vestingQueues := make([]types.VestingQueue, 0) + rng := collections.NewPrefixedPairRange[uint64, time.Time](auctionId) + err := k.VestingQueue.Walk(ctx, rng, func(key collections.Pair[uint64, time.Time], vestingQueue types.VestingQueue) (bool, error) { + vestingQueues = append(vestingQueues, vestingQueue) + return false, nil + }) + return vestingQueues, err +} + // ApplyVestingSchedules stores vesting queues based on the vesting schedules of the auction and // sets status to vesting. -func (k Keeper) ApplyVestingSchedules(ctx sdk.Context, auction types.AuctionI) error { +func (k Keeper) ApplyVestingSchedules(ctx context.Context, auction types.AuctionI) error { payingReserveAddr := auction.GetPayingReserveAddress() vestingReserveAddr := auction.GetVestingReserveAddress() payingCoinDenom := auction.GetPayingCoinDenom() @@ -22,9 +57,12 @@ func (k Keeper) ApplyVestingSchedules(ctx sdk.Context, auction types.AuctionI) e return err } - _ = auction.SetStatus(types.AuctionStatusFinished) - k.SetAuction(ctx, auction) - + if err := auction.SetStatus(types.AuctionStatusFinished); err != nil { + return err + } + if err := k.Auction.Set(ctx, auction.GetId(), auction); err != nil { + return err + } } else { // Move reserve coins from the paying reserve to the vesting reserve account if err := k.bankKeeper.SendCoins(ctx, payingReserveAddr, vestingReserveAddr, sdk.NewCoins(reserveCoin)); err != nil { @@ -33,26 +71,39 @@ func (k Keeper) ApplyVestingSchedules(ctx sdk.Context, auction types.AuctionI) e remaining := reserveCoin for i, schedule := range auction.GetVestingSchedules() { - payingAmt := sdk.NewDecFromInt(reserveCoin.Amount).MulTruncate(schedule.Weight).TruncateInt() + payingAmt := math.LegacyNewDecFromInt(reserveCoin.Amount).MulTruncate(schedule.Weight).TruncateInt() // All the remaining paying coin goes to the last vesting queue if i == vsLen-1 { payingAmt = remaining.Amount } - k.SetVestingQueue(ctx, types.VestingQueue{ - AuctionId: auction.GetId(), - Auctioneer: auction.GetAuctioneer().String(), - PayingCoin: sdk.NewCoin(payingCoinDenom, payingAmt), - ReleaseTime: schedule.ReleaseTime, - Released: false, - }) + if err := k.VestingQueue.Set( + ctx, + collections.Join( + auction.GetId(), + schedule.ReleaseTime, + ), + types.VestingQueue{ + AuctionId: auction.GetId(), + Auctioneer: auction.GetAuctioneer().String(), + PayingCoin: sdk.NewCoin(payingCoinDenom, payingAmt), + ReleaseTime: schedule.ReleaseTime, + Released: false, + }, + ); err != nil { + return err + } remaining = remaining.SubAmount(payingAmt) } - _ = auction.SetStatus(types.AuctionStatusVesting) - k.SetAuction(ctx, auction) + if err := auction.SetStatus(types.AuctionStatusVesting); err != nil { + return err + } + if err := k.Auction.Set(ctx, auction.GetId(), auction); err != nil { + return err + } } return nil diff --git a/x/fundraising/keeper/vesting_test.go b/x/fundraising/keeper/vesting_test.go index 50c0a63a..f40b4785 100644 --- a/x/fundraising/keeper/vesting_test.go +++ b/x/fundraising/keeper/vesting_test.go @@ -43,8 +43,8 @@ func (s *KeeperTestSuite) TestApplyVestingSchedules_NoSchedule() { s.Require().False(auctioneerBalance.IsZero()) // Status must be finished - a, found := s.keeper.GetAuction(s.ctx, auction.GetId()) - s.Require().True(found) + a, err := s.keeper.Auction.Get(s.ctx, auction.GetId()) + s.Require().NoError(err) s.Require().Equal(types.AuctionStatusFinished, a.GetStatus()) } @@ -87,7 +87,10 @@ func (s *KeeperTestSuite) TestApplyVestingSchedules_RemainingCoin() { vestingReserveAddr := auction.GetVestingReserveAddress() vestingReserveCoin := s.getBalance(vestingReserveAddr, auction.PayingCoinDenom) - for _, vq := range s.keeper.GetVestingQueuesByAuctionId(s.ctx, auction.GetId()) { + vqs, err := s.keeper.GetVestingQueuesByAuctionId(s.ctx, auction.GetId()) + s.Require().NoError(err) + + for _, vq := range vqs { vestingReserveCoin = vestingReserveCoin.Sub(vq.PayingCoin) } s.Require().True(vestingReserveCoin.IsZero()) diff --git a/x/fundraising/module.go b/x/fundraising/module.go deleted file mode 100644 index eace89c1..00000000 --- a/x/fundraising/module.go +++ /dev/null @@ -1,205 +0,0 @@ -package fundraising - -import ( - "context" - "encoding/json" - "fmt" - "math/rand" - - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/cosmos-sdk/client" - "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/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - - "github.com/tendermint/fundraising/x/fundraising/client/cli" - "github.com/tendermint/fundraising/x/fundraising/keeper" - "github.com/tendermint/fundraising/x/fundraising/simulation" - "github.com/tendermint/fundraising/x/fundraising/types" -) - -var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModuleSimulation = AppModule{} -) - -// ---------------------------------------------------------------------------- -// AppModuleBasic -// ---------------------------------------------------------------------------- - -// AppModuleBasic implements the AppModuleBasic interface for the module. -type AppModuleBasic struct { - cdc codec.Codec -} - -func NewAppModuleBasic(cdc codec.Codec) AppModuleBasic { - return AppModuleBasic{cdc: cdc} -} - -// Name returns the module's name. -func (AppModuleBasic) Name() string { - return types.ModuleName -} - -// RegisterLegacyAminoCodec registers the module's types for the legacy amino codec. -func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - types.RegisterCodec(cdc) -} - -// RegisterInterfaces registers the module's interface types. -func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { - types.RegisterInterfaces(reg) -} - -// DefaultGenesis returns the module's default genesis state. -func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(types.DefaultGenesisState()) -} - -// ValidateGenesis performs genesis state validation for the module. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { - var genState types.GenesisState - if err := cdc.UnmarshalJSON(bz, &genState); err != nil { - return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) - } - return genState.Validate() -} - -// RegisterRESTRoutes registers the module's REST service handlers. -func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {} - -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { - panic(err) - } -} - -// GetTxCmd returns the module's root tx command. -func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.GetTxCmd() -} - -// GetQueryCmd returns the module's root query command. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd(types.StoreKey) -} - -// ---------------------------------------------------------------------------- -// AppModule -// ---------------------------------------------------------------------------- - -// AppModule implements the AppModule interface for the module. -type AppModule struct { - AppModuleBasic - - keeper keeper.Keeper - accountKeeper types.AccountKeeper - bankKeeper types.BankKeeper - distrKeeper types.DistrKeeper -} - -// NewAppModule creates a new AppModule object. -func NewAppModule( - cdc codec.Codec, - keeper keeper.Keeper, - accountKeeper types.AccountKeeper, - bankKeeper types.BankKeeper, - distrKeeper types.DistrKeeper, -) AppModule { - return AppModule{ - AppModuleBasic: NewAppModuleBasic(cdc), - keeper: keeper, - accountKeeper: accountKeeper, - bankKeeper: bankKeeper, - distrKeeper: distrKeeper, - } -} - -// Name returns the module's name. -func (am AppModule) Name() string { - return am.AppModuleBasic.Name() -} - -// QuerierRoute returns the module's query routing key. -func (AppModule) QuerierRoute() string { - return types.QuerierRoute -} - -// RegisterServices registers a GRPC query service to respond to the -// module-specific GRPC queries. -func (am AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterQueryServer(cfg.QueryServer(), keeper.Querier{Keeper: am.keeper}) - types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) -} - -// RegisterInvariants registers the module's invariants. -func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { - keeper.RegisterInvariants(ir, am.keeper) -} - -// InitGenesis performs the modle's genesis initialization -// It returns no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { - var genState types.GenesisState - cdc.MustUnmarshalJSON(gs, &genState) - am.keeper.InitGenesis(ctx, genState) - return []abci.ValidatorUpdate{} -} - -// ExportGenesis returns the module's exported genesis state as raw JSON bytes. -func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { - genState := am.keeper.ExportGenesis(ctx) - return cdc.MustMarshalJSON(genState) -} - -// ConsensusVersion implements ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 2 } - -// BeginBlock executes all ABCI BeginBlock logic respective to the module. -func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { - BeginBlocker(ctx, am.keeper) -} - -// EndBlock executes all ABCI EndBlock logic respective to the module. -// It returns no validator updates. -func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} -} - -// ---------------------------------------------------------------------------- -// AppModuleSimulation -// ---------------------------------------------------------------------------- - -// GenerateGenesisState creates a randomized GenState of the module. -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { - simulation.RandomizedGenState(simState) -} - -// ProposalContents doesn't return any content functions for governance proposals. -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - -// RandomizedParams creates randomized param changes for the simulator. -func (am AppModule) RandomizedParams(r *rand.Rand) []simtypes.LegacyParamChange { - return simulation.ParamChanges(r) -} - -// RegisterStoreDecoder registers store decoders. -func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { - sdr[types.StoreKey] = simulation.NewDecodeStore(am.cdc) -} - -// WeightedOperations returns the all the gov module operations with their respective weights. -func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { - return simulation.WeightedOperations( - simState.AppParams, simState.Cdc, am.accountKeeper, am.bankKeeper, am.keeper, - ) -} diff --git a/x/fundraising/module/autocli.go b/x/fundraising/module/autocli.go new file mode 100644 index 00000000..3e10d71d --- /dev/null +++ b/x/fundraising/module/autocli.go @@ -0,0 +1,117 @@ +package fundraising + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + + modulev1 "github.com/tendermint/fundraising/api/fundraising/fundraising/v1" + "github.com/tendermint/fundraising/x/fundraising/keeper" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + moduloOpts := &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: modulev1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Params", + Use: "params", + Short: "Shows the parameters of the module", + }, + { + RpcMethod: "ListAllowedBidder", + Use: "list-allowed-bidder", + Short: "List all AllowedBidder", + }, + { + RpcMethod: "GetAllowedBidder", + Use: "get-allowed-bidder [id]", + Short: "Gets a AllowedBidder", + Alias: []string{"show-allowed-bidder"}, + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "auctionId"}}, + }, + { + RpcMethod: "ListVestingQueue", + Use: "list-vesting-queue", + Short: "List all VestingQueue", + }, + { + RpcMethod: "ListBid", + Use: "list-bid", + Short: "List all Bid", + }, + { + RpcMethod: "GetBid", + Use: "get-bid [id]", + Short: "Gets a Bid by id", + Alias: []string{"show-bid"}, + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "id"}}, + }, + { + RpcMethod: "ListAuction", + Use: "list-auction", + Short: "List all auction", + }, + { + RpcMethod: "GetAuction", + Use: "get-auction [id]", + Short: "Gets a auction by id", + Alias: []string{"show-auction"}, + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "id"}}, + }, + // this line is used by ignite scaffolding # autocli/query + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: modulev1.Msg_ServiceDesc.ServiceName, + EnhanceCustomCommand: true, // only required if you want to use the custom command + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "UpdateParams", + Skip: true, // skipped because authority gated + }, + { + RpcMethod: "CreateFixedPriceAuction", + Use: "create-fixed-price-auction [start-price] [selling-coin] [paying-coin-denom] [vesting-schedules] [start-time] [end-time]", + Short: "Send a CreateFixedPriceAuction tx", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "startPrice"}, {ProtoField: "sellingCoin"}, {ProtoField: "payingCoinDenom"}, {ProtoField: "vestingSchedules"}, {ProtoField: "startTime"}, {ProtoField: "endTime"}}, + }, + { + RpcMethod: "CreateBatchAuction", + Use: "create-batch-auction [start-price] [min-bid-price] [selling-coin] [paying-coin-denom] [vesting-schedules] [max-extended-round] [extended-round-rate] [start-time] [end-time]", + Short: "Send a CreateBatchAuction tx", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "startPrice"}, {ProtoField: "minBidPrice"}, {ProtoField: "sellingCoin"}, {ProtoField: "payingCoinDenom"}, {ProtoField: "vestingSchedules"}, {ProtoField: "maxExtendedRound"}, {ProtoField: "extendedRoundRate"}, {ProtoField: "startTime"}, {ProtoField: "endTime"}}, + }, + { + RpcMethod: "CancelAuction", + Use: "cancel-auction [auction-id]", + Short: "Send a CancelAuction tx", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "auctionId"}}, + }, + { + RpcMethod: "PlaceBid", + Use: "place-bid [auction-id] [bid-type] [price] [coin]", + Short: "Send a PlaceBid tx", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "auctionId"}, {ProtoField: "bidType"}, {ProtoField: "price"}, {ProtoField: "coin"}}, + }, + { + RpcMethod: "ModifyBid", + Use: "modify-bid [auction-id] [bid-id] [price] [coin]", + Short: "Send a ModifyBid tx", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "auctionId"}, {ProtoField: "bidId"}, {ProtoField: "price"}, {ProtoField: "coin"}}, + }, + // this line is used by ignite scaffolding # autocli/tx + }, + }, + } + if keeper.EnableAddAllowedBidder { + moduloOpts.Tx.RpcCommandOptions = append(moduloOpts.Tx.RpcCommandOptions, &autocliv1.RpcCommandOptions{ + RpcMethod: "AddAllowedBidder", + Use: "add-allowed-bidder [auction-id] [allowed-bidder]", + Short: "Send a AddAllowedBidder tx", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "auctionId"}, {ProtoField: "allowedBidder"}}, + }) + } + + return moduloOpts +} diff --git a/x/fundraising/module/genesis.go b/x/fundraising/module/genesis.go new file mode 100644 index 00000000..13f0f580 --- /dev/null +++ b/x/fundraising/module/genesis.go @@ -0,0 +1,150 @@ +package fundraising + +import ( + "context" + "errors" + "fmt" + "time" + + "cosmossdk.io/collections" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/tendermint/fundraising/x/fundraising/keeper" + "github.com/tendermint/fundraising/x/fundraising/types" +) + +// InitGenesis initializes the module's state from a provided genesis state. +func InitGenesis(ctx context.Context, k keeper.Keeper, genState types.GenesisState) error { + // Prevents from nil slice + if len(genState.Params.AuctionCreationFee) == 0 { + genState.Params.AuctionCreationFee = sdk.Coins{} + } + if len(genState.Params.PlaceBidFee) == 0 { + genState.Params.PlaceBidFee = sdk.Coins{} + } + + // Set all the auction + for _, elem := range genState.AuctionList { + auction, err := types.UnpackAuction(elem) + if err != nil { + return err + } + auctionID, err := k.AuctionSeq.Next(ctx) + if err != nil { + return err + } + if err := auction.SetId(auctionID); err != nil { + return err + } + if err := k.Auction.Set(ctx, auctionID, auction); err != nil { + return err + } + } + + // Set all the allowedBidder + for _, elem := range genState.AllowedBidderList { + bidder, err := sdk.AccAddressFromBech32(elem.Bidder) + if err != nil { + return err + } + if err := k.AllowedBidder.Set(ctx, collections.Join(elem.AuctionId, bidder), elem); err != nil { + return err + } + } + + // Set all the bid + for _, elem := range genState.BidList { + _, err := k.Auction.Get(ctx, elem.AuctionId) + if errors.Is(err, collections.ErrNotFound) { + return fmt.Errorf("bid auction %d is not found", elem.AuctionId) + } + + bidID, err := k.GetNextBidIdWithUpdate(ctx, elem.AuctionId) + if err != nil { + return err + } + elem.Id = bidID + if err := k.Bid.Set(ctx, collections.Join(elem.AuctionId, elem.Id), elem); err != nil { + return err + } + } + + // Set all the vestingQueue + for _, elem := range genState.VestingQueueList { + _, err := k.Auction.Get(ctx, elem.AuctionId) + if errors.Is(err, collections.ErrNotFound) { + return fmt.Errorf("vesting queue auction %d is not found", elem.AuctionId) + } + + if err := k.VestingQueue.Set( + ctx, + collections.Join( + elem.AuctionId, + elem.ReleaseTime, + ), + elem); err != nil { + return err + } + } + + // this line is used by starport scaffolding # genesis/module/init + + return k.Params.Set(ctx, genState.Params) +} + +// ExportGenesis returns the module's exported genesis. +func ExportGenesis(ctx context.Context, k keeper.Keeper) (*types.GenesisState, error) { + var err error + + genesis := types.DefaultGenesis() + genesis.Params, err = k.Params.Get(ctx) + if err != nil { + return nil, err + } + // Prevents from nil slice + if len(genesis.Params.AuctionCreationFee) == 0 { + genesis.Params.AuctionCreationFee = sdk.Coins{} + } + if len(genesis.Params.PlaceBidFee) == 0 { + genesis.Params.PlaceBidFee = sdk.Coins{} + } + + if err := k.AllowedBidder.Walk(ctx, nil, func(_ collections.Pair[uint64, sdk.AccAddress], val types.AllowedBidder) (bool, error) { + genesis.AllowedBidderList = append(genesis.AllowedBidderList, val) + return false, nil + }); err != nil { + return nil, err + } + if err := k.VestingQueue.Walk(ctx, nil, func(key collections.Pair[uint64, time.Time], val types.VestingQueue) (bool, error) { + genesis.VestingQueueList = append(genesis.VestingQueueList, val) + return false, nil + }); err != nil { + return nil, err + } + + err = k.Bid.Walk(ctx, nil, func(key collections.Pair[uint64, uint64], val types.Bid) (bool, error) { + genesis.BidList = append(genesis.BidList, val) + return false, nil + }) + if err != nil { + return nil, err + } + + genesis.AuctionList = make([]*codectypes.Any, 0) + err = k.Auction.Walk(ctx, nil, func(key uint64, elem types.AuctionI) (bool, error) { + auctionAny, err := types.PackAuction(elem) + if err != nil { + panic(err) + } + genesis.AuctionList = append(genesis.AuctionList, auctionAny) + return false, nil + }) + if err != nil { + return nil, err + } + + // this line is used by starport scaffolding # genesis/module/export + + return genesis, nil +} diff --git a/x/fundraising/module/genesis_test.go b/x/fundraising/module/genesis_test.go new file mode 100644 index 00000000..743dd0e4 --- /dev/null +++ b/x/fundraising/module/genesis_test.go @@ -0,0 +1,139 @@ +package fundraising_test + +import ( + "encoding/json" + "math/rand" + "testing" + + "cosmossdk.io/math" + "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/stretchr/testify/require" + + keepertest "github.com/tendermint/fundraising/testutil/keeper" + "github.com/tendermint/fundraising/testutil/nullify" + "github.com/tendermint/fundraising/testutil/sample" + fundraising "github.com/tendermint/fundraising/x/fundraising/module" + "github.com/tendermint/fundraising/x/fundraising/types" +) + +func TestGenesis(t *testing.T) { + auctionAny1, _ := types.PackAuction(types.NewFixedPriceAuction( + &types.BaseAuction{Id: 1}, + sdk.NewInt64Coin("denom1", 1_000), + )) + auctionAny2, _ := types.PackAuction(types.NewFixedPriceAuction( + &types.BaseAuction{Id: 2}, + sdk.NewInt64Coin("denom2", 2_000), + )) + + genesisState := types.GenesisState{ + Params: types.DefaultParams(), + + AllowedBidderList: []types.AllowedBidder{ + { + AuctionId: 0, + Bidder: sample.Address(), + }, + { + AuctionId: 1, + Bidder: sample.Address(), + }, + }, + VestingQueueList: []types.VestingQueue{ + { + AuctionId: 0, + }, + { + AuctionId: 1, + }, + }, + BidList: []types.Bid{ + { + Id: 0, + }, + { + Id: 1, + }, + }, + AuctionList: []*codectypes.Any{auctionAny1, auctionAny2}, + // this line is used by starport scaffolding # genesis/test/state + } + + k, ctx, _ := keepertest.FundraisingKeeper(t) + err := fundraising.InitGenesis(ctx, k, genesisState) + require.NoError(t, err) + got, err := fundraising.ExportGenesis(ctx, k) + require.NoError(t, err) + require.NotNil(t, got) + + nullify.Fill(&genesisState) + nullify.Fill(got) + + require.ElementsMatch(t, genesisState.AllowedBidderList, got.AllowedBidderList) + require.ElementsMatch(t, genesisState.VestingQueueList, got.VestingQueueList) + require.ElementsMatch(t, genesisState.BidList, got.BidList) + require.ElementsMatch(t, genesisState.AuctionList, got.AuctionList) + // this line is used by starport scaffolding # genesis/test/assert +} + +// TestRandomizedGenState tests the normal scenario of applying RandomizedGenState. +// Abnormal scenarios are not tested here. +func TestRandomizedGenState(t *testing.T) { + interfaceRegistry := codectypes.NewInterfaceRegistry() + cdc := codec.NewProtoCodec(interfaceRegistry) + s := rand.NewSource(1) + r := rand.New(s) + + simState := module.SimulationState{ + AppParams: make(simtypes.AppParams), + Cdc: cdc, + Rand: r, + NumBonded: 3, + Accounts: simtypes.RandomAccounts(r, 3), + InitialStake: math.NewInt(1000), + GenState: make(map[string]json.RawMessage), + } + + fundraising.RandomizedGenState(&simState) + + var genState types.GenesisState + simState.Cdc.MustUnmarshalJSON(simState.GenState[types.ModuleName], &genState) + + dec1 := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(36122540))) + dec3 := uint32(5) + + require.Equal(t, dec1, genState.Params.AuctionCreationFee) + require.Equal(t, dec3, genState.Params.ExtendedPeriod) +} + +// TestRandomizedGenState tests abnormal scenarios of applying RandomizedGenState. +func TestRandomizedGenState1(t *testing.T) { + interfaceRegistry := codectypes.NewInterfaceRegistry() + cdc := codec.NewProtoCodec(interfaceRegistry) + + s := rand.NewSource(1) + r := rand.New(s) + + // all these tests will panic + tests := []struct { + simState module.SimulationState + panicMsg string + }{ + { // panic => reason: incomplete initialization of the simState + module.SimulationState{}, "invalid memory address or nil pointer dereference"}, + { // panic => reason: incomplete initialization of the simState + module.SimulationState{ + AppParams: make(simtypes.AppParams), + Cdc: cdc, + Rand: r, + }, "assignment to entry in nil map"}, + } + + for _, tt := range tests { + require.Panicsf(t, func() { fundraising.RandomizedGenState(&tt.simState) }, tt.panicMsg) + } +} diff --git a/x/fundraising/module/module.go b/x/fundraising/module/module.go new file mode 100644 index 00000000..293cefd4 --- /dev/null +++ b/x/fundraising/module/module.go @@ -0,0 +1,255 @@ +package fundraising + +import ( + "context" + "encoding/json" + "fmt" + "sort" + + "cosmossdk.io/core/address" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/store" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client" + "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/types/module" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "golang.org/x/exp/maps" + + // this line is used by starport scaffolding # 1 + + modulev1 "github.com/tendermint/fundraising/api/fundraising/fundraising/module/v1" + "github.com/tendermint/fundraising/x/fundraising/keeper" + "github.com/tendermint/fundraising/x/fundraising/types" +) + +var ( + _ module.AppModuleBasic = (*AppModule)(nil) + _ module.AppModuleSimulation = (*AppModule)(nil) + _ module.HasGenesis = (*AppModule)(nil) + _ module.HasInvariants = (*AppModule)(nil) + _ module.HasConsensusVersion = (*AppModule)(nil) + + _ appmodule.AppModule = (*AppModule)(nil) + _ appmodule.HasBeginBlocker = (*AppModule)(nil) + _ appmodule.HasEndBlocker = (*AppModule)(nil) +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic implements the AppModuleBasic interface that defines the +// independent methods a Cosmos SDK module needs to implement. +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the name of the module as a string. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +// RegisterLegacyAminoCodec 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. +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} + +// RegisterInterfaces registers a module's interface types and their concrete implementations as proto.Message. +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns a default 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. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis used to validate the GenesisState, given in its json.RawMessage form. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { + var genState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return genState.Validate() +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface that defines the inter-dependent methods that modules need to implement +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper +} + +func NewAppModule( + cdc codec.Codec, + keeper keeper.Keeper, + accountKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, +) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + } +} + +// RegisterServices registers a gRPC query service to respond to the module-specific gRPC queries +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQueryServerImpl(am.keeper)) +} + +// RegisterInvariants registers the invariants of the module. If an invariant deviates from its predicted value, the InvariantRegistry triggers appropriate logic (most often the chain will be halted) +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the module's genesis initialization. It returns no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) { + var genState types.GenesisState + // Initialize global index to index in genesis state + cdc.MustUnmarshalJSON(gs, &genState) + if err := InitGenesis(ctx, am.keeper, genState); err != nil { + panic(err) + } +} + +// ExportGenesis returns the module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genState, err := ExportGenesis(ctx, am.keeper) + if err != nil { + panic(err) + } + return cdc.MustMarshalJSON(genState) +} + +// ConsensusVersion is a sequence number for state-breaking change of the module. +// It should be incremented on each consensus-breaking change introduced by the module. +// To avoid wrong/empty versions, the initial version should be set to 1. +func (AppModule) ConsensusVersion() uint64 { return 1 } + +// BeginBlock contains the logic that is automatically triggered at the beginning of each block. +// The begin block implementation is optional. +func (am AppModule) BeginBlock(ctx context.Context) error { + if err := am.keeper.BeginBlocker(ctx); err != nil { + return err + } + return nil +} + +// EndBlock contains the logic that is automatically triggered at the end of each block. +// The end block implementation is optional. +func (am AppModule) EndBlock(_ context.Context) error { + return nil +} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// ---------------------------------------------------------------------------- +// App Wiring Setup +// ---------------------------------------------------------------------------- + +func init() { + appmodule.Register( + &modulev1.Module{}, + appmodule.Provide(ProvideModule), + appmodule.Invoke(InvokeSetHooks), + ) +} + +type ModuleInputs struct { + depinject.In + + AddressCodec address.Codec + StoreService store.KVStoreService + Cdc codec.Codec + Config *modulev1.Module + Logger log.Logger + + AccountKeeper types.AccountKeeper + BankKeeper types.BankKeeper + DistrKeeper types.DistrKeeper +} + +type ModuleOutputs struct { + depinject.Out + + FundraisingKeeper keeper.Keeper + Module appmodule.AppModule +} + +func ProvideModule(in ModuleInputs) ModuleOutputs { + // default to governance authority if not provided + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) + } + k := keeper.NewKeeper( + in.Cdc, + in.AddressCodec, + in.StoreService, + in.Logger, + authority.String(), + in.AccountKeeper, + in.BankKeeper, + in.DistrKeeper, + ) + m := NewAppModule( + in.Cdc, + k, + in.AccountKeeper, + in.BankKeeper, + ) + + return ModuleOutputs{FundraisingKeeper: k, Module: m} +} + +func InvokeSetHooks(keeper *keeper.Keeper, hooks map[string]types.FundraisingHooks) error { + if keeper == nil || hooks == nil { + return nil + } + + // Default ordering is lexical by module name. + // Explicit ordering can be added to the module config if required. + modNames := maps.Keys(hooks) + order := modNames + sort.Strings(order) + + var multiHooks types.MultiFundraisingHooks + for _, modName := range order { + hook, ok := hooks[modName] + if !ok { + return fmt.Errorf("can't find staking hooks for module %s", modName) + } + multiHooks = append(multiHooks, hook) + } + + keeper.SetHooks(multiHooks) + return nil +} diff --git a/x/fundraising/module/simulation.go b/x/fundraising/module/simulation.go new file mode 100644 index 00000000..83234974 --- /dev/null +++ b/x/fundraising/module/simulation.go @@ -0,0 +1,197 @@ +package fundraising + +import ( + "math/rand" + + 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/simulation" + + "github.com/tendermint/fundraising/testutil/sample" + + fundraisingsimulation "github.com/tendermint/fundraising/x/fundraising/simulation" + "github.com/tendermint/fundraising/x/fundraising/types" +) + +// avoid unused import issue +var _ = sample.AccAddress + +const ( + opWeightMsgCreateFixedPriceAuction = "op_weight_msg_create_fixed_price_auction" + defaultWeightMsgCreateFixedPriceAuction int = 20 + + opWeightMsgCreateBatchAuction = "op_weight_msg_create_batch_auction" + defaultWeightMsgCreateBatchAuction int = 20 + + opWeightMsgCancelAuction = "op_weight_msg_cancel_auction" + defaultWeightMsgCancelAuction int = 15 + + opWeightMsgPlaceBid = "op_weight_msg_place_bid" + defaultWeightMsgPlaceBid int = 80 + + opWeightMsgModifyBid = "op_weight_msg_modify_bid" + defaultWeightMsgModifyBid int = 15 + + // this line is used by starport scaffolding # simapp/module/const +) + +const ( + AuctionCreationFee = "auction_creation_fee" + ExtendedPeriod = "extended_period" +) + +// GenAuctionCreationFee return randomized auction creation fee. +func GenAuctionCreationFee(r *rand.Rand) sdk.Coins { + return sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, int64(simtypes.RandIntBetween(r, 0, 100_000_000)))) +} + +// GenExtendedPeriod return default extended period. +func GenExtendedPeriod(r *rand.Rand) uint32 { + return uint32(simtypes.RandIntBetween(r, int(types.DefaultExtendedPeriod), 10)) +} + +// RandomizedGenState generates a random GenesisState. +func RandomizedGenState(simState *module.SimulationState) { + accs := make([]string, len(simState.Accounts)) + for i, acc := range simState.Accounts { + accs[i] = acc.Address.String() + } + fundraisingGenesis := types.GenesisState{ + Params: types.DefaultParams(), + // this line is used by starport scaffolding # simapp/module/genesisState + } + + var auctionCreationFee sdk.Coins + simState.AppParams.GetOrGenerate(AuctionCreationFee, &auctionCreationFee, simState.Rand, func(r *rand.Rand) { + auctionCreationFee = GenAuctionCreationFee(r) + }) + + var extendedPeriod uint32 + simState.AppParams.GetOrGenerate(ExtendedPeriod, &extendedPeriod, simState.Rand, func(r *rand.Rand) { + extendedPeriod = GenExtendedPeriod(r) + }) + + fundraisingGenesis.Params.AuctionCreationFee = auctionCreationFee + fundraisingGenesis.Params.ExtendedPeriod = extendedPeriod + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&fundraisingGenesis) +} + +// GenerateGenesisState creates a randomized GenState of the module. +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + RandomizedGenState(simState) +} + +// RegisterStoreDecoder registers a decoder. +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} + +// WeightedOperations returns the all the gov module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + operations := make([]simtypes.WeightedOperation, 0) + + var weightMsgCreateFixedPriceAuction int + simState.AppParams.GetOrGenerate(opWeightMsgCreateFixedPriceAuction, &weightMsgCreateFixedPriceAuction, nil, + func(_ *rand.Rand) { + weightMsgCreateFixedPriceAuction = defaultWeightMsgCreateFixedPriceAuction + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgCreateFixedPriceAuction, + fundraisingsimulation.SimulateMsgCreateFixedPriceAuction(am.accountKeeper, am.bankKeeper, am.keeper, simState.TxConfig), + )) + + var weightMsgCreateBatchAuction int + simState.AppParams.GetOrGenerate(opWeightMsgCreateBatchAuction, &weightMsgCreateBatchAuction, nil, + func(_ *rand.Rand) { + weightMsgCreateBatchAuction = defaultWeightMsgCreateBatchAuction + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgCreateBatchAuction, + fundraisingsimulation.SimulateMsgCreateBatchAuction(am.accountKeeper, am.bankKeeper, am.keeper, simState.TxConfig), + )) + + var weightMsgCancelAuction int + simState.AppParams.GetOrGenerate(opWeightMsgCancelAuction, &weightMsgCancelAuction, nil, + func(_ *rand.Rand) { + weightMsgCancelAuction = defaultWeightMsgCancelAuction + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgCancelAuction, + fundraisingsimulation.SimulateMsgCancelAuction(am.accountKeeper, am.bankKeeper, am.keeper, simState.TxConfig), + )) + + var weightMsgPlaceBid int + simState.AppParams.GetOrGenerate(opWeightMsgPlaceBid, &weightMsgPlaceBid, nil, + func(_ *rand.Rand) { + weightMsgPlaceBid = defaultWeightMsgPlaceBid + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgPlaceBid, + fundraisingsimulation.SimulateMsgPlaceBid(am.accountKeeper, am.bankKeeper, am.keeper, simState.TxConfig), + )) + + var weightMsgModifyBid int + simState.AppParams.GetOrGenerate(opWeightMsgModifyBid, &weightMsgModifyBid, nil, + func(_ *rand.Rand) { + weightMsgModifyBid = defaultWeightMsgModifyBid + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgModifyBid, + fundraisingsimulation.SimulateMsgModifyBid(am.accountKeeper, am.bankKeeper, am.keeper, simState.TxConfig), + )) + + // this line is used by starport scaffolding # simapp/module/operation + + return operations +} + +// ProposalMsgs returns msgs used for governance proposals for simulations. +func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { + return []simtypes.WeightedProposalMsg{ + simulation.NewWeightedProposalMsg( + opWeightMsgCreateFixedPriceAuction, + defaultWeightMsgCreateFixedPriceAuction, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + fundraisingsimulation.SimulateMsgCreateFixedPriceAuction(am.accountKeeper, am.bankKeeper, am.keeper, simState.TxConfig) + return nil + }, + ), + simulation.NewWeightedProposalMsg( + opWeightMsgCreateBatchAuction, + defaultWeightMsgCreateBatchAuction, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + fundraisingsimulation.SimulateMsgCreateBatchAuction(am.accountKeeper, am.bankKeeper, am.keeper, simState.TxConfig) + return nil + }, + ), + simulation.NewWeightedProposalMsg( + opWeightMsgCancelAuction, + defaultWeightMsgCancelAuction, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + fundraisingsimulation.SimulateMsgCancelAuction(am.accountKeeper, am.bankKeeper, am.keeper, simState.TxConfig) + return nil + }, + ), + simulation.NewWeightedProposalMsg( + opWeightMsgPlaceBid, + defaultWeightMsgPlaceBid, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + fundraisingsimulation.SimulateMsgPlaceBid(am.accountKeeper, am.bankKeeper, am.keeper, simState.TxConfig) + return nil + }, + ), + simulation.NewWeightedProposalMsg( + opWeightMsgModifyBid, + defaultWeightMsgModifyBid, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + fundraisingsimulation.SimulateMsgModifyBid(am.accountKeeper, am.bankKeeper, am.keeper, simState.TxConfig) + return nil + }, + ), + // this line is used by starport scaffolding # simapp/module/OpMsg + } +} diff --git a/x/fundraising/simulation/cancel_auction.go b/x/fundraising/simulation/cancel_auction.go new file mode 100644 index 00000000..404b37d1 --- /dev/null +++ b/x/fundraising/simulation/cancel_auction.go @@ -0,0 +1,83 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + + "github.com/tendermint/fundraising/x/fundraising/keeper" + "github.com/tendermint/fundraising/x/fundraising/types" +) + +// SimulateMsgCancelAuction generates a SimulateMsgCancelAuction with random values +// nolint: interfacer +func SimulateMsgCancelAuction( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, + txGen client.TxConfig, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + msg := &types.MsgCancelAuction{} + auctions, err := k.Auctions(ctx) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "failed to get auctions"), nil, nil + } + + r.Shuffle(len(auctions), func(i, j int) { + auctions[i], auctions[j] = auctions[j], auctions[i] + }) + + var simAccount simtypes.Account + var auction types.AuctionI + + // Find an auction that is not started yet + skip := true + + for _, auction = range auctions { + if auction.GetStatus() == types.AuctionStatusStandBy { + skip = false + break + } + } + if skip { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "no auction to cancel"), nil, nil + } + + accs = shuffleSimAccounts(r, accs) + + // Only the auction's auctioneer can cancel + for _, acc := range accs { + if acc.Address.Equals(auction.GetAuctioneer()) { + simAccount = acc + } + } + + account := ak.GetAccount(ctx, simAccount.Address) + spendable := bk.SpendableCoins(ctx, account.GetAddress()) + auctioneer := account.GetAddress().String() + + msg = types.NewMsgCancelAuction(auctioneer, auction.GetId()) + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: txGen, + Cdc: nil, + Msg: msg, + Context: ctx, + SimAccount: simAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendable, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} diff --git a/x/fundraising/simulation/create_batch_auction.go b/x/fundraising/simulation/create_batch_auction.go new file mode 100644 index 00000000..572d7966 --- /dev/null +++ b/x/fundraising/simulation/create_batch_auction.go @@ -0,0 +1,93 @@ +package simulation + +import ( + "math/rand" + + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + + "github.com/tendermint/fundraising/x/fundraising/keeper" + "github.com/tendermint/fundraising/x/fundraising/types" +) + +// SimulateMsgCreateBatchAuction generates a MsgCreateRatioPlan with random values +// nolint: interfacer +func SimulateMsgCreateBatchAuction( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, + txGen client.TxConfig, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + msg := &types.MsgCreateBatchAuction{} + simAccount, _ := simtypes.RandomAcc(r, accs) + + account := ak.GetAccount(ctx, simAccount.Address) + spendable := bk.SpendableCoins(ctx, account.GetAddress()) + + params, err := k.Params.Get(ctx) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "failed to get params"), nil, err + } + + _, hasNeg := spendable.SafeSub(params.AuctionCreationFee...) + if hasNeg { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "insufficient balance for auction creation fee"), nil, nil + } + + auctioneer := account.GetAddress() + startPrice := math.LegacyNewDecWithPrec(int64(simtypes.RandIntBetween(r, 1, 10)), 1) // 0.1 ~ 1.0 + minBidPrice := math.LegacyNewDecWithPrec(int64(simtypes.RandIntBetween(r, 1, 10)), 2) + sellingCoin := sdk.NewInt64Coin(testCoinDenoms[r.Intn(len(testCoinDenoms))], int64(simtypes.RandIntBetween(r, 100000000000, 100000000000000))) + payingCoinDenom := sdk.DefaultBondDenom + vestingSchedules := []types.VestingSchedule{} + maxExtendedRound := uint32(simtypes.RandIntBetween(r, 1, 5)) + extendedRoundRate := math.LegacyNewDecWithPrec(int64(simtypes.RandIntBetween(r, 1, 3)), 1) // 0.1 ~ 0.3 + startTime := ctx.BlockTime().AddDate(0, 0, simtypes.RandIntBetween(r, 0, 2)) + endTime := startTime.AddDate(0, simtypes.RandIntBetween(r, 1, 12), 0) + + if _, err := fundBalances(ctx, r, bk, auctioneer, testCoinDenoms); err != nil { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "failed to fund auctioneer"), nil, err + } + + // Call spendable coins here again to get the funded balances + _, hasNeg = bk.SpendableCoins(ctx, account.GetAddress()).SafeSub(sdk.NewCoins(sellingCoin)...) + if hasNeg { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "insufficient balance to reserve selling coin"), nil, nil + } + + msg = types.NewMsgCreateBatchAuction( + auctioneer.String(), + startPrice, + minBidPrice, + sellingCoin, + payingCoinDenom, + vestingSchedules, + maxExtendedRound, + extendedRoundRate, + startTime, + endTime, + ) + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: txGen, + Cdc: nil, + Msg: msg, + Context: ctx, + SimAccount: simAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendable, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} diff --git a/x/fundraising/simulation/create_fixed_price_auction.go b/x/fundraising/simulation/create_fixed_price_auction.go new file mode 100644 index 00000000..24c0cea7 --- /dev/null +++ b/x/fundraising/simulation/create_fixed_price_auction.go @@ -0,0 +1,87 @@ +package simulation + +import ( + "math/rand" + + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + + "github.com/tendermint/fundraising/x/fundraising/keeper" + "github.com/tendermint/fundraising/x/fundraising/types" +) + +// SimulateMsgCreateFixedPriceAuction generates a MsgCreateFixedAmountPlan with random values +// nolint: interfacer +func SimulateMsgCreateFixedPriceAuction( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, + txGen client.TxConfig, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + msg := &types.MsgCreateFixedPriceAuction{} + simAccount, _ := simtypes.RandomAcc(r, accs) + + account := ak.GetAccount(ctx, simAccount.Address) + spendable := bk.SpendableCoins(ctx, account.GetAddress()) + + params, err := k.Params.Get(ctx) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "failed to get params"), nil, err + } + + _, hasNeg := spendable.SafeSub(params.AuctionCreationFee...) + if hasNeg { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "insufficient balance for auction creation fee"), nil, nil + } + + auctioneer := account.GetAddress() + startPrice := math.LegacyNewDecWithPrec(int64(simtypes.RandIntBetween(r, 1, 10)), 1) // 0.1 ~ 1.0 + sellingCoin := sdk.NewInt64Coin(testCoinDenoms[r.Intn(len(testCoinDenoms))], int64(simtypes.RandIntBetween(r, 10000000000, 1000000000000))) + payingCoinDenom := sdk.DefaultBondDenom + vestingSchedules := make([]types.VestingSchedule, 0) + startTime := ctx.BlockTime().AddDate(0, 0, simtypes.RandIntBetween(r, 0, 2)) + endTime := startTime.AddDate(0, simtypes.RandIntBetween(r, 1, 12), 0) + + if _, err := fundBalances(ctx, r, bk, auctioneer, testCoinDenoms); err != nil { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "failed to fund auctioneer"), nil, err + } + + // Call spendable coins here again to get the funded balances + _, hasNeg = bk.SpendableCoins(ctx, account.GetAddress()).SafeSub(sdk.NewCoins(sellingCoin)...) + if hasNeg { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "insufficient balance to reserve selling coin"), nil, nil + } + + msg = types.NewMsgCreateFixedPriceAuction( + auctioneer.String(), + startPrice, + sellingCoin, + payingCoinDenom, + vestingSchedules, + startTime, + endTime, + ) + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: txGen, + Cdc: nil, + Msg: msg, + Context: ctx, + SimAccount: simAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendable, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} diff --git a/x/fundraising/simulation/decoder.go b/x/fundraising/simulation/decoder.go deleted file mode 100644 index 95025c1e..00000000 --- a/x/fundraising/simulation/decoder.go +++ /dev/null @@ -1,40 +0,0 @@ -package simulation - -import ( - "bytes" - "fmt" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/types/kv" - - "github.com/tendermint/fundraising/x/fundraising/types" -) - -// NewDecodeStore returns a decoder function closure that unmarshals the KVPair's -// Value to the corresponding fundraising type. -func NewDecodeStore(cdc codec.Codec) func(kvA, kvB kv.Pair) string { - return func(kvA, kvB kv.Pair) string { - switch { - case bytes.Equal(kvA.Key[:1], types.AuctionKeyPrefix): - var aA, aB types.BaseAuction - cdc.MustUnmarshal(kvA.Value, &aA) - cdc.MustUnmarshal(kvB.Value, &aB) - return fmt.Sprintf("%v\n%v", aA, aB) - - case bytes.Equal(kvA.Key[:1], types.BidKeyPrefix): - var bA, bB types.Bid - cdc.MustUnmarshal(kvA.Value, &bA) - cdc.MustUnmarshal(kvB.Value, &bB) - return fmt.Sprintf("%v\n%v", bA, bB) - - case bytes.Equal(kvA.Key[:1], types.VestingQueueKeyPrefix): - var vA, vB types.VestingQueue - cdc.MustUnmarshal(kvA.Value, &vA) - cdc.MustUnmarshal(kvB.Value, &vB) - return fmt.Sprintf("%v\n%v", vA, vB) - - default: - panic(fmt.Sprintf("invalid fundraising key prefix %X", kvA.Key[:1])) - } - } -} diff --git a/x/fundraising/simulation/decoder_test.go b/x/fundraising/simulation/decoder_test.go deleted file mode 100644 index 97145475..00000000 --- a/x/fundraising/simulation/decoder_test.go +++ /dev/null @@ -1,54 +0,0 @@ -package simulation_test - -import ( - "fmt" - "testing" - - simappparams "cosmossdk.io/simapp/params" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/kv" - "github.com/stretchr/testify/require" - - "github.com/tendermint/fundraising/x/fundraising/simulation" - "github.com/tendermint/fundraising/x/fundraising/types" -) - -func TestDecodeFarmingStore(t *testing.T) { - cdc := simappparams.MakeTestEncodingConfig().Codec - dec := simulation.NewDecodeStore(cdc) - - baseAuction := types.BaseAuction{StartPrice: sdk.NewDec(0)} - bid := types.Bid{Price: sdk.NewDec(0)} - vestingQueue := types.VestingQueue{} - - kvPairs := kv.Pairs{ - Pairs: []kv.Pair{ - {Key: types.AuctionKeyPrefix, Value: cdc.MustMarshal(&baseAuction)}, - {Key: types.BidKeyPrefix, Value: cdc.MustMarshal(&bid)}, - {Key: types.VestingQueueKeyPrefix, Value: cdc.MustMarshal(&vestingQueue)}, - {Key: []byte{0x99}, Value: []byte{0x99}}, - }, - } - - tests := []struct { - name string - expectedLog string - }{ - {"Auction", fmt.Sprintf("%v\n%v", baseAuction, baseAuction)}, - {"Bid", fmt.Sprintf("%v\n%v", bid, bid)}, - {"VestingQueue", fmt.Sprintf("%v\n%v", vestingQueue, vestingQueue)}, - {"other", ""}, - } - for i, tt := range tests { - i, tt := i, tt - t.Run(tt.name, func(t *testing.T) { - switch i { - case len(tests) - 1: - require.Panics(t, func() { dec(kvPairs.Pairs[i], kvPairs.Pairs[i]) }, tt.name) - default: - got := dec(kvPairs.Pairs[i], kvPairs.Pairs[i]) - require.EqualValues(t, tt.expectedLog, got, tt.name) - } - }) - } -} diff --git a/x/fundraising/simulation/genesis.go b/x/fundraising/simulation/genesis.go deleted file mode 100644 index 235658fc..00000000 --- a/x/fundraising/simulation/genesis.go +++ /dev/null @@ -1,52 +0,0 @@ -package simulation - -// DONTCOVER - -import ( - "math/rand" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/types/simulation" - - "github.com/tendermint/fundraising/x/fundraising/types" -) - -// Simulation parameter constants. -const ( - AuctionCreationFee = "auction_creation_fee" - ExtendedPeriod = "extended_period" -) - -// GenAuctionCreationFee return randomized auction creation fee. -func GenAuctionCreationFee(r *rand.Rand) sdk.Coins { - return sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, int64(simulation.RandIntBetween(r, 0, 100_000_000)))) -} - -// GenExtendedPeriod return default extended period. -func GenExtendedPeriod(r *rand.Rand) uint32 { - return uint32(simulation.RandIntBetween(r, int(types.DefaultExtendedPeriod), 10)) -} - -// RandomizedGenState generates a random GenesisState. -func RandomizedGenState(simState *module.SimulationState) { - var auctionCreationFee sdk.Coins - simState.AppParams.GetOrGenerate( - simState.Cdc, AuctionCreationFee, &auctionCreationFee, simState.Rand, - func(r *rand.Rand) { auctionCreationFee = GenAuctionCreationFee(r) }, - ) - - var extendedPeriod uint32 - simState.AppParams.GetOrGenerate( - simState.Cdc, ExtendedPeriod, &extendedPeriod, simState.Rand, - func(r *rand.Rand) { extendedPeriod = GenExtendedPeriod(r) }, - ) - - genState := types.GenesisState{ - Params: types.Params{ - AuctionCreationFee: auctionCreationFee, - ExtendedPeriod: extendedPeriod, - }, - } - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&genState) -} diff --git a/x/fundraising/simulation/genesis_test.go b/x/fundraising/simulation/genesis_test.go deleted file mode 100644 index a55e0902..00000000 --- a/x/fundraising/simulation/genesis_test.go +++ /dev/null @@ -1,76 +0,0 @@ -package simulation_test - -import ( - "encoding/json" - "math/rand" - "testing" - - "github.com/stretchr/testify/require" - - "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/tendermint/fundraising/x/fundraising/simulation" - "github.com/tendermint/fundraising/x/fundraising/types" -) - -// TestRandomizedGenState tests the normal scenario of applying RandomizedGenState. -// Abnormal scenarios are not tested here. -func TestRandomizedGenState(t *testing.T) { - interfaceRegistry := codectypes.NewInterfaceRegistry() - cdc := codec.NewProtoCodec(interfaceRegistry) - s := rand.NewSource(1) - r := rand.New(s) - - simState := module.SimulationState{ - AppParams: make(simtypes.AppParams), - Cdc: cdc, - Rand: r, - NumBonded: 3, - Accounts: simtypes.RandomAccounts(r, 3), - InitialStake: sdk.NewInt(1000), - GenState: make(map[string]json.RawMessage), - } - - simulation.RandomizedGenState(&simState) - - var genState types.GenesisState - simState.Cdc.MustUnmarshalJSON(simState.GenState[types.ModuleName], &genState) - - dec1 := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(36122540))) - dec3 := uint32(5) - - require.Equal(t, dec1, genState.Params.AuctionCreationFee) - require.Equal(t, dec3, genState.Params.ExtendedPeriod) -} - -// TestRandomizedGenState tests abnormal scenarios of applying RandomizedGenState. -func TestRandomizedGenState1(t *testing.T) { - interfaceRegistry := codectypes.NewInterfaceRegistry() - cdc := codec.NewProtoCodec(interfaceRegistry) - - s := rand.NewSource(1) - r := rand.New(s) - - // all these tests will panic - tests := []struct { - simState module.SimulationState - panicMsg string - }{ - { // panic => reason: incomplete initialization of the simState - module.SimulationState{}, "invalid memory address or nil pointer dereference"}, - { // panic => reason: incomplete initialization of the simState - module.SimulationState{ - AppParams: make(simtypes.AppParams), - Cdc: cdc, - Rand: r, - }, "assignment to entry in nil map"}, - } - - for _, tt := range tests { - require.Panicsf(t, func() { simulation.RandomizedGenState(&tt.simState) }, tt.panicMsg) - } -} diff --git a/x/fundraising/simulation/helpers.go b/x/fundraising/simulation/helpers.go new file mode 100644 index 00000000..a5399b60 --- /dev/null +++ b/x/fundraising/simulation/helpers.go @@ -0,0 +1,61 @@ +package simulation + +import ( + "context" + "math/rand" + + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + + "github.com/tendermint/fundraising/x/fundraising/keeper" + "github.com/tendermint/fundraising/x/fundraising/types" +) + +var testCoinDenoms = []string{ + "denoma", + "denomb", + "denomc", + "denomd", +} + +func init() { + keeper.EnableAddAllowedBidder = true +} + +// FindAccount find a specific address from an account list +func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { + creator, err := sdk.AccAddressFromBech32(address) + if err != nil { + panic(err) + } + return simtypes.FindAccount(accs, creator) +} + +// fundBalances mints random amount of coins with the provided coin denoms and +// send them to the simulated account. +func fundBalances(ctx context.Context, r *rand.Rand, bk types.BankKeeper, acc sdk.AccAddress, denoms []string) (sdk.Coins, error) { + mintCoins := sdk.NewCoins() + for _, denom := range denoms { + mintCoins = mintCoins.Add(sdk.NewInt64Coin(denom, 100_000_000_000_000_000)) + } + + if err := bk.MintCoins(ctx, minttypes.ModuleName, mintCoins); err != nil { + return nil, err + } + + if err := bk.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, acc, mintCoins); err != nil { + return nil, err + } + return mintCoins, nil +} + +// shuffleSimAccounts returns randomly shuffled simulation accounts. +func shuffleSimAccounts(r *rand.Rand, accs []simtypes.Account) []simtypes.Account { + accs2 := make([]simtypes.Account, len(accs)) + copy(accs2, accs) + r.Shuffle(len(accs2), func(i, j int) { + accs2[i], accs2[j] = accs2[j], accs2[i] + }) + return accs2 +} diff --git a/x/fundraising/simulation/modify_bid.go b/x/fundraising/simulation/modify_bid.go new file mode 100644 index 00000000..581d6718 --- /dev/null +++ b/x/fundraising/simulation/modify_bid.go @@ -0,0 +1,121 @@ +package simulation + +import ( + "math/rand" + + "cosmossdk.io/collections" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + + "github.com/tendermint/fundraising/x/fundraising/keeper" + "github.com/tendermint/fundraising/x/fundraising/types" +) + +func SimulateMsgModifyBid( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, + txGen client.TxConfig, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + msg := &types.MsgModifyBid{} + auctions, err := k.Auctions(ctx) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "failed to get auctions"), nil, nil + } + + // Select a random auction + auction := auctions[r.Intn(len(auctions))] + + if auction.GetStatus() != types.AuctionStatusStarted { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "auction must be started status"), nil, nil + } + + bids, err := k.Bids(ctx) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "failed to get bids"), nil, nil + } + + // Select a random bid + bid := bids[r.Intn(len(bids))] + + simAccount, _ := simtypes.RandomAcc(r, accs) + + account := ak.GetAccount(ctx, simAccount.Address) + spendable := bk.SpendableCoins(ctx, account.GetAddress()) + + bidder := account.GetAddress() + sellingCoinDenom := auction.GetSellingCoin().Denom + payingCoinDenom := auction.GetPayingCoinDenom() + + if _, err := fundBalances(ctx, r, bk, bidder, testCoinDenoms); err != nil { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "failed to fund bidder"), nil, err + } + + switch auction.GetType() { + case types.AuctionTypeFixedPrice: + bid.Type = types.BidTypeFixedPrice + bid.Price = auction.GetStartPrice() + if r.Int()%2 == 0 { + bid.Coin = sdk.NewInt64Coin(payingCoinDenom, int64(simtypes.RandIntBetween(r, 100000, 1000000000))) + } else { + bid.Coin = sdk.NewInt64Coin(sellingCoinDenom, int64(simtypes.RandIntBetween(r, 100000, 1000000000))) + } + case types.AuctionTypeBatch: + bid.Price = auction.GetStartPrice().Add(math.LegacyNewDecWithPrec(int64(simtypes.RandIntBetween(r, 1, 5)), 1)) // StartPrice + 0.1 ~ 0.5 + if r.Int()%2 == 0 { + bid.Type = types.BidTypeBatchWorth + bid.Coin = sdk.NewInt64Coin(payingCoinDenom, int64(simtypes.RandIntBetween(r, 100000, 1000000000))) + } else { + bid.Type = types.BidTypeBatchMany + bid.Coin = sdk.NewInt64Coin(sellingCoinDenom, int64(simtypes.RandIntBetween(r, 100000, 1000000000))) + } + } + + bidReserveAmt := bid.ConvertToPayingAmount(payingCoinDenom) + maxBidAmt := bid.ConvertToSellingAmount(payingCoinDenom) + + if !bk.SpendableCoins(ctx, bidder).AmountOf(payingCoinDenom).GT(bidReserveAmt) { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "insufficient balance to place a bid"), nil, nil + } + + allowedBidder, err := k.AllowedBidder.Get(ctx, collections.Join(auction.GetId(), bidder)) + if err == nil { + maxBidAmt = maxBidAmt.Add(allowedBidder.MaxBidAmount) + } + + newAllowedBidder := types.NewAllowedBidder(auction.GetId(), bidder, maxBidAmt) + if err := k.AddAllowedBidders(ctx, auction.GetId(), []types.AllowedBidder{newAllowedBidder}); err != nil { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "failed to add allowed bidders"), nil, nil + } + + msg = types.NewMsgModifyBid( + auction.GetId(), + bidder.String(), + bid.Id, + bid.Price, + bid.Coin, + ) + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: txGen, + Cdc: nil, + Msg: msg, + Context: ctx, + SimAccount: simAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendable, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} diff --git a/x/fundraising/simulation/operations.go b/x/fundraising/simulation/operations.go deleted file mode 100644 index 557d450a..00000000 --- a/x/fundraising/simulation/operations.go +++ /dev/null @@ -1,411 +0,0 @@ -package simulation - -import ( - "math/rand" - - simappparams "cosmossdk.io/simapp/params" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/cosmos/cosmos-sdk/x/simulation" - - appparams "github.com/tendermint/fundraising/app/params" - "github.com/tendermint/fundraising/x/fundraising/keeper" - "github.com/tendermint/fundraising/x/fundraising/types" -) - -// Simulation operation weights constants. -const ( - OpWeightMsgCreateFixedPriceAuction = "op_weight_msg_create_fixed_price_auction" - OpWeightMsgCreateBatchAuction = "op_weight_msg_create_batch_auction" - OpWeightMsgCancelAuction = "op_weight_msg_cancel_auction" - OpWeightMsgPlaceBid = "op_weight_msg_place_bid" -) - -var ( - testCoinDenoms = []string{ - "denoma", - "denomb", - "denomc", - "denomd", - } -) - -func init() { - keeper.EnableAddAllowedBidder = true -} - -// WeightedOperations returns all the operations from the module with their respective weights. -func WeightedOperations( - appParams simtypes.AppParams, cdc codec.JSONCodec, ak types.AccountKeeper, - bk types.BankKeeper, k keeper.Keeper, -) simulation.WeightedOperations { - - var weightMsgCreateFixedPriceAuction int - appParams.GetOrGenerate(cdc, OpWeightMsgCreateFixedPriceAuction, &weightMsgCreateFixedPriceAuction, nil, - func(_ *rand.Rand) { - weightMsgCreateFixedPriceAuction = appparams.DefaultWeightMsgCreateFixedPriceAuction - }, - ) - - var weightMsgCreateBatchAuction int - appParams.GetOrGenerate(cdc, OpWeightMsgCreateBatchAuction, &weightMsgCreateBatchAuction, nil, - func(_ *rand.Rand) { - weightMsgCreateBatchAuction = appparams.DefaultWeightMsgCreateBatchAuction - }, - ) - - var weightMsgCancelAuction int - appParams.GetOrGenerate(cdc, OpWeightMsgCancelAuction, &weightMsgCancelAuction, nil, - func(_ *rand.Rand) { - weightMsgCancelAuction = appparams.DefaultWeightMsgCancelAuction - }, - ) - - var weightMsgPlaceBid int - appParams.GetOrGenerate(cdc, OpWeightMsgPlaceBid, &weightMsgPlaceBid, nil, - func(_ *rand.Rand) { - weightMsgPlaceBid = appparams.DefaultWeightMsgPlaceBid - }, - ) - - return simulation.WeightedOperations{ - simulation.NewWeightedOperation( - weightMsgCreateFixedPriceAuction, - SimulateMsgCreateFixedPriceAuction(ak, bk, k), - ), - simulation.NewWeightedOperation( - weightMsgCreateBatchAuction, - SimulateMsgCreateBatchAuction(ak, bk, k), - ), - simulation.NewWeightedOperation( - weightMsgCancelAuction, - SimulateMsgCancelAuction(ak, bk, k), - ), - simulation.NewWeightedOperation( - weightMsgPlaceBid, - SimulateMsgPlaceBid(ak, bk, k), - ), - } -} - -// SimulateMsgCreateFixedPriceAuction generates a MsgCreateFixedAmountPlan with random values -// nolint: interfacer -func SimulateMsgCreateFixedPriceAuction(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper) simtypes.Operation { - return func( - r *rand.Rand, bApp *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - - account := ak.GetAccount(ctx, simAccount.Address) - spendable := bk.SpendableCoins(ctx, account.GetAddress()) - - params := k.GetParams(ctx) - _, hasNeg := spendable.SafeSub(params.AuctionCreationFee...) - if hasNeg { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgCreateFixedPriceAuction, "insufficient balance for auction creation fee"), nil, nil - } - - auctioneer := account.GetAddress() - startPrice := sdk.NewDecWithPrec(int64(simtypes.RandIntBetween(r, 1, 10)), 1) // 0.1 ~ 1.0 - sellingCoin := sdk.NewInt64Coin(testCoinDenoms[r.Intn(len(testCoinDenoms))], int64(simtypes.RandIntBetween(r, 10000000000, 1000000000000))) - payingCoinDenom := sdk.DefaultBondDenom - vestingSchedules := []types.VestingSchedule{} - startTime := ctx.BlockTime().AddDate(0, 0, simtypes.RandIntBetween(r, 0, 2)) - endTime := startTime.AddDate(0, simtypes.RandIntBetween(r, 1, 12), 0) - - if _, err := fundBalances(ctx, r, bk, auctioneer, testCoinDenoms); err != nil { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgCreateFixedPriceAuction, "failed to fund auctioneer"), nil, err - } - - // Call spendable coins here again to get the funded balances - _, hasNeg = bk.SpendableCoins(ctx, account.GetAddress()).SafeSub(sdk.NewCoins(sellingCoin)...) - if hasNeg { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgCreateFixedPriceAuction, "insufficient balance to reserve selling coin"), nil, nil - } - - msg := types.NewMsgCreateFixedPriceAuction( - auctioneer.String(), - startPrice, - sellingCoin, - payingCoinDenom, - vestingSchedules, - startTime, - endTime, - ) - - txCtx := simulation.OperationInput{ - R: r, - App: bApp, - TxGen: simappparams.MakeTestEncodingConfig().TxConfig, - Cdc: nil, - Msg: msg, - MsgType: msg.Type(), - Context: ctx, - SimAccount: simAccount, - AccountKeeper: ak, - Bankkeeper: bk, - ModuleName: types.ModuleName, - CoinsSpentInMsg: spendable, - } - - return simulation.GenAndDeliverTxWithRandFees(txCtx) - } -} - -// SimulateMsgCreateBatchAuction generates a MsgCreateRatioPlan with random values -// nolint: interfacer -func SimulateMsgCreateBatchAuction(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper) simtypes.Operation { - return func( - r *rand.Rand, bApp *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - - account := ak.GetAccount(ctx, simAccount.Address) - spendable := bk.SpendableCoins(ctx, account.GetAddress()) - - params := k.GetParams(ctx) - _, hasNeg := spendable.SafeSub(params.AuctionCreationFee...) - if hasNeg { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgCreateBatchAuction, "insufficient balance for auction creation fee"), nil, nil - } - - auctioneer := account.GetAddress() - startPrice := sdk.NewDecWithPrec(int64(simtypes.RandIntBetween(r, 1, 10)), 1) // 0.1 ~ 1.0 - minBidPrice := sdk.NewDecWithPrec(int64(simtypes.RandIntBetween(r, 1, 10)), 2) - sellingCoin := sdk.NewInt64Coin(testCoinDenoms[r.Intn(len(testCoinDenoms))], int64(simtypes.RandIntBetween(r, 100000000000, 100000000000000))) - payingCoinDenom := sdk.DefaultBondDenom - vestingSchedules := []types.VestingSchedule{} - maxExtendedRound := uint32(simtypes.RandIntBetween(r, 1, 5)) - extendedRoundRate := sdk.NewDecWithPrec(int64(simtypes.RandIntBetween(r, 1, 3)), 1) // 0.1 ~ 0.3 - startTime := ctx.BlockTime().AddDate(0, 0, simtypes.RandIntBetween(r, 0, 2)) - endTime := startTime.AddDate(0, simtypes.RandIntBetween(r, 1, 12), 0) - - if _, err := fundBalances(ctx, r, bk, auctioneer, testCoinDenoms); err != nil { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgCreateBatchAuction, "failed to fund auctioneer"), nil, err - } - - // Call spendable coins here again to get the funded balances - _, hasNeg = bk.SpendableCoins(ctx, account.GetAddress()).SafeSub(sdk.NewCoins(sellingCoin)...) - if hasNeg { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgCreateBatchAuction, "insufficient balance to reserve selling coin"), nil, nil - } - - msg := types.NewMsgCreateBatchAuction( - auctioneer.String(), - startPrice, - minBidPrice, - sellingCoin, - payingCoinDenom, - vestingSchedules, - maxExtendedRound, - extendedRoundRate, - startTime, - endTime, - ) - - txCtx := simulation.OperationInput{ - R: r, - App: bApp, - TxGen: simappparams.MakeTestEncodingConfig().TxConfig, - Cdc: nil, - Msg: msg, - MsgType: msg.Type(), - Context: ctx, - SimAccount: simAccount, - AccountKeeper: ak, - Bankkeeper: bk, - ModuleName: types.ModuleName, - CoinsSpentInMsg: spendable, - } - - return simulation.GenAndDeliverTxWithRandFees(txCtx) - } -} - -// SimulateMsgCancelAuction generates a SimulateMsgCancelAuction with random values -// nolint: interfacer -func SimulateMsgCancelAuction(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper) simtypes.Operation { - return func( - r *rand.Rand, bApp *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - auctions := k.GetAuctions(ctx) - r.Shuffle(len(auctions), func(i, j int) { - auctions[i], auctions[j] = auctions[j], auctions[i] - }) - - var simAccount simtypes.Account - var auction types.AuctionI - - // Find an auction that is not started yet - skip := true - - for _, auction = range auctions { - if auction.GetStatus() == types.AuctionStatusStandBy { - skip = false - break - } - } - if skip { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgCancelAuction, "no auction to cancel"), nil, nil - } - - accs = shuffleSimAccounts(r, accs) - - // Only the auction's auctioneer can cancel - for _, acc := range accs { - if acc.Address.Equals(auction.GetAuctioneer()) { - simAccount = acc - } - } - - account := ak.GetAccount(ctx, simAccount.Address) - spendable := bk.SpendableCoins(ctx, account.GetAddress()) - auctioneer := account.GetAddress().String() - - msg := types.NewMsgCancelAuction(auctioneer, auction.GetId()) - - txCtx := simulation.OperationInput{ - R: r, - App: bApp, - TxGen: simappparams.MakeTestEncodingConfig().TxConfig, - Cdc: nil, - Msg: msg, - MsgType: msg.Type(), - Context: ctx, - SimAccount: simAccount, - AccountKeeper: ak, - Bankkeeper: bk, - ModuleName: types.ModuleName, - CoinsSpentInMsg: spendable, - } - - return simulation.GenAndDeliverTxWithRandFees(txCtx) - } -} - -// SimulateMsgPlaceBid generates a MsgPlaceBid with random values -// nolint: interfacer -func SimulateMsgPlaceBid(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper) simtypes.Operation { - return func( - r *rand.Rand, bApp *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - auctions := k.GetAuctions(ctx) - if len(auctions) == 0 { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgPlaceBid, "no auction to place a bid"), nil, nil - } - - // Select a random auction - auction := auctions[r.Intn(len(auctions))] - - if auction.GetStatus() != types.AuctionStatusStarted { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgPlaceBid, "auction must be started status"), nil, nil - } - - simAccount, _ := simtypes.RandomAcc(r, accs) - - account := ak.GetAccount(ctx, simAccount.Address) - spendable := bk.SpendableCoins(ctx, account.GetAddress()) - - bidder := account.GetAddress() - sellingCoinDenom := auction.GetSellingCoin().Denom - payingCoinDenom := auction.GetPayingCoinDenom() - - if _, err := fundBalances(ctx, r, bk, bidder, testCoinDenoms); err != nil { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgPlaceBid, "failed to fund bidder"), nil, err - } - - var bid types.Bid - switch auction.GetType() { - case types.AuctionTypeFixedPrice: - bid.Type = types.BidTypeFixedPrice - bid.Price = auction.GetStartPrice() - if r.Int()%2 == 0 { - bid.Coin = sdk.NewInt64Coin(payingCoinDenom, int64(simtypes.RandIntBetween(r, 100000, 1000000000))) - } else { - bid.Coin = sdk.NewInt64Coin(sellingCoinDenom, int64(simtypes.RandIntBetween(r, 100000, 1000000000))) - } - case types.AuctionTypeBatch: - bid.Price = auction.GetStartPrice().Add(sdk.NewDecWithPrec(int64(simtypes.RandIntBetween(r, 1, 5)), 1)) // StartPrice + 0.1 ~ 0.5 - if r.Int()%2 == 0 { - bid.Type = types.BidTypeBatchWorth - bid.Coin = sdk.NewInt64Coin(payingCoinDenom, int64(simtypes.RandIntBetween(r, 100000, 1000000000))) - } else { - bid.Type = types.BidTypeBatchMany - bid.Coin = sdk.NewInt64Coin(sellingCoinDenom, int64(simtypes.RandIntBetween(r, 100000, 1000000000))) - } - } - - bidReserveAmt := bid.ConvertToPayingAmount(payingCoinDenom) - maxBidAmt := bid.ConvertToSellingAmount(payingCoinDenom) - - if !bk.SpendableCoins(ctx, bidder).AmountOf(payingCoinDenom).GT(bidReserveAmt) { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgPlaceBid, "insufficient balance to place a bid"), nil, nil - } - - allowedBidder, found := k.GetAllowedBidder(ctx, auction.GetId(), bidder) - if found { - maxBidAmt = maxBidAmt.Add(allowedBidder.MaxBidAmount) - } - - newAllowedBidder := types.NewAllowedBidder(bidder, maxBidAmt) - if err := k.AddAllowedBidders(ctx, auction.GetId(), []types.AllowedBidder{newAllowedBidder}); err != nil { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgPlaceBid, "failed to add allowed bidders"), nil, nil - } - - msg := types.NewMsgPlaceBid( - auction.GetId(), - bidder.String(), - bid.Type, - bid.Price, - bid.Coin, - ) - - txCtx := simulation.OperationInput{ - R: r, - App: bApp, - TxGen: simappparams.MakeTestEncodingConfig().TxConfig, - Cdc: nil, - Msg: msg, - MsgType: msg.Type(), - Context: ctx, - SimAccount: simAccount, - AccountKeeper: ak, - Bankkeeper: bk, - ModuleName: types.ModuleName, - CoinsSpentInMsg: spendable, - } - - return simulation.GenAndDeliverTxWithRandFees(txCtx) - } -} - -// fundBalances mints random amount of coins with the provided coin denoms and -// send them to the simulated account. -func fundBalances(ctx sdk.Context, r *rand.Rand, bk types.BankKeeper, acc sdk.AccAddress, denoms []string) (sdk.Coins, error) { - var mintCoins sdk.Coins - for _, denom := range denoms { - mintCoins = mintCoins.Add(sdk.NewInt64Coin(denom, 100_000_000_000_000_000)) - } - - if err := bk.MintCoins(ctx, minttypes.ModuleName, mintCoins); err != nil { - return nil, err - } - - if err := bk.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, acc, mintCoins); err != nil { - return nil, err - } - return mintCoins, nil -} - -// shuffleSimAccounts returns randomly shuffled simulation accounts. -func shuffleSimAccounts(r *rand.Rand, accs []simtypes.Account) []simtypes.Account { - accs2 := make([]simtypes.Account, len(accs)) - copy(accs2, accs) - r.Shuffle(len(accs2), func(i, j int) { - accs2[i], accs2[j] = accs2[j], accs2[i] - }) - return accs2 -} diff --git a/x/fundraising/simulation/operations_test.go b/x/fundraising/simulation/operations_test.go deleted file mode 100644 index 0a5bf01e..00000000 --- a/x/fundraising/simulation/operations_test.go +++ /dev/null @@ -1,264 +0,0 @@ -package simulation_test - -import ( - "math/rand" - "testing" - - abci "github.com/cometbft/cometbft/abci/types" - tmrand "github.com/cometbft/cometbft/libs/rand" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/stretchr/testify/require" - - chain "github.com/tendermint/fundraising/app" - "github.com/tendermint/fundraising/app/params" - "github.com/tendermint/fundraising/testutil/simapp" - "github.com/tendermint/fundraising/x/fundraising/simulation" - "github.com/tendermint/fundraising/x/fundraising/types" -) - -// TestWeightedOperations tests the weights of the operations. -func TestWeightedOperations(t *testing.T) { - app, chainID, ctx := createTestApp(false) - - ctx.WithChainID(chainID) - - cdc := types.ModuleCdc - appParams := make(simtypes.AppParams) - - weightedOps := simulation.WeightedOperations(appParams, cdc, app.AccountKeeper, app.BankKeeper, app.FundraisingKeeper) - - s := rand.NewSource(1) - r := rand.New(s) - accs := getTestingAccounts(t, r, app, ctx, 1) - - expected := []struct { - weight int - opMsgRoute string - opMsgName string - }{ - {params.DefaultWeightMsgCreateFixedPriceAuction, types.ModuleName, types.TypeMsgCreateFixedPriceAuction}, - {params.DefaultWeightMsgCreateBatchAuction, types.ModuleName, types.TypeMsgCreateBatchAuction}, - {params.DefaultWeightMsgCancelAuction, types.ModuleName, types.TypeMsgCancelAuction}, - {params.DefaultWeightMsgPlaceBid, types.ModuleName, types.TypeMsgPlaceBid}, - } - - for i, w := range weightedOps { - operationMsg, _, _ := w.Op()(r, app.BaseApp, ctx, accs, ctx.ChainID()) - // the following checks are very much dependent from the ordering of the output given - // by WeightedOperations. if the ordering in WeightedOperations changes some tests - // will fail - require.Equal(t, expected[i].weight, w.Weight(), "weight should be the same") - require.Equal(t, expected[i].opMsgRoute, operationMsg.Route, "route should be the same") - require.Equal(t, expected[i].opMsgName, operationMsg.Name, "operation Msg name should be the same") - } -} - -func TestSimulateCreateFixedPriceAuction(t *testing.T) { - app, chainID, ctx := createTestApp(false) - - // setup a single account - s := rand.NewSource(1) - r := rand.New(s) - - accounts := getTestingAccounts(t, r, app, ctx, 1) - - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{ - Height: app.LastBlockHeight() + 1, - AppHash: app.LastCommitID().Hash, - ChainID: chainID, - }}) - - op := simulation.SimulateMsgCreateFixedPriceAuction(app.AccountKeeper, app.BankKeeper, app.FundraisingKeeper) - opMsg, futureOps, err := op(r, app.BaseApp, ctx, accounts, "") - require.NoError(t, err) - require.True(t, opMsg.OK) - require.Len(t, futureOps, 0) - - var msg types.MsgCreateFixedPriceAuction - types.ModuleCdc.MustUnmarshalJSON(opMsg.Msg, &msg) - - require.Equal(t, types.TypeMsgCreateFixedPriceAuction, msg.Type()) - require.Equal(t, types.ModuleName, msg.Route()) - require.Equal(t, "cosmos1tnh2q55v8wyygtt9srz5safamzdengsnqeycj3", msg.Auctioneer) - require.Equal(t, "denomc", msg.SellingCoin.Denom) - require.Equal(t, sdk.DefaultBondDenom, msg.PayingCoinDenom) - require.Equal(t, sdk.MustNewDecFromStr("0.5"), msg.StartPrice) -} - -func TestSimulateCreateBatchAuction(t *testing.T) { - app, chainID, ctx := createTestApp(false) - - // setup a single account - s := rand.NewSource(1) - r := rand.New(s) - - accounts := getTestingAccounts(t, r, app, ctx, 1) - - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{ - Height: app.LastBlockHeight() + 1, - AppHash: app.LastCommitID().Hash, - ChainID: chainID, - }}) - - op := simulation.SimulateMsgCreateBatchAuction(app.AccountKeeper, app.BankKeeper, app.FundraisingKeeper) - opMsg, futureOps, err := op(r, app.BaseApp, ctx, accounts, "") - require.NoError(t, err) - require.True(t, opMsg.OK) - require.Len(t, futureOps, 0) - - var msg types.MsgCreateBatchAuction - types.ModuleCdc.MustUnmarshalJSON(opMsg.Msg, &msg) - - require.Equal(t, types.TypeMsgCreateBatchAuction, msg.Type()) - require.Equal(t, types.ModuleName, msg.Route()) - require.Equal(t, "cosmos1tnh2q55v8wyygtt9srz5safamzdengsnqeycj3", msg.Auctioneer) - require.Equal(t, "denomb", msg.SellingCoin.Denom) - require.Equal(t, "stake", msg.PayingCoinDenom) - require.Equal(t, uint32(1), msg.MaxExtendedRound) - require.Equal(t, sdk.MustNewDecFromStr("0.1"), msg.ExtendedRoundRate) -} - -func TestSimulateCancelAuction(t *testing.T) { - app, chainID, ctx := createTestApp(false) - - // setup a single account - s := rand.NewSource(1) - r := rand.New(s) - - accounts := getTestingAccounts(t, r, app, ctx, 1) - - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{ - Height: app.LastBlockHeight() + 1, - AppHash: app.LastCommitID().Hash, - ChainID: chainID, - }}) - - // Create a fixed price auction - _, err := app.FundraisingKeeper.CreateFixedPriceAuction(ctx, &types.MsgCreateFixedPriceAuction{ - Auctioneer: accounts[0].Address.String(), - StartPrice: sdk.MustNewDecFromStr("0.5"), - SellingCoin: sdk.NewInt64Coin("denoma", 5000000000), - PayingCoinDenom: "denomb", - VestingSchedules: []types.VestingSchedule{}, - StartTime: ctx.BlockTime().AddDate(0, 1, 0), - EndTime: ctx.BlockTime().AddDate(0, 2, 0), - }) - require.NoError(t, err) - - op := simulation.SimulateMsgCancelAuction(app.AccountKeeper, app.BankKeeper, app.FundraisingKeeper) - opMsg, futureOps, err := op(r, app.BaseApp, ctx, accounts, "") - require.NoError(t, err) - require.True(t, opMsg.OK) - require.Len(t, futureOps, 0) - - var msg types.MsgCancelAuction - types.ModuleCdc.MustUnmarshalJSON(opMsg.Msg, &msg) - - require.Equal(t, types.TypeMsgCancelAuction, msg.Type()) - require.Equal(t, types.ModuleName, msg.Route()) - require.Equal(t, "cosmos1tnh2q55v8wyygtt9srz5safamzdengsnqeycj3", msg.Auctioneer) - require.Equal(t, uint64(1), msg.AuctionId) -} - -func TestSimulatePlaceBid(t *testing.T) { - app, chainID, ctx := createTestApp(false) - - // Setup a single account - s := rand.NewSource(1) - r := rand.New(s) - - accounts := getTestingAccounts(t, r, app, ctx, 1) - - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{ - Height: app.LastBlockHeight() + 1, - AppHash: app.LastCommitID().Hash, - ChainID: chainID, - }}) - - // Create a fixed price auction - _, err := app.FundraisingKeeper.CreateFixedPriceAuction(ctx, &types.MsgCreateFixedPriceAuction{ - Auctioneer: accounts[0].Address.String(), - StartPrice: sdk.MustNewDecFromStr("0.5"), - SellingCoin: sdk.NewInt64Coin("denoma", 5000000000), - PayingCoinDenom: "denomb", - VestingSchedules: []types.VestingSchedule{}, - StartTime: ctx.BlockTime(), - EndTime: ctx.BlockTime().AddDate(0, 1, 0), - }) - require.NoError(t, err) - - // Create a batch auction - _, err = app.FundraisingKeeper.CreateBatchAuction(ctx, &types.MsgCreateBatchAuction{ - Auctioneer: accounts[0].Address.String(), - StartPrice: sdk.MustNewDecFromStr("0.5"), - MinBidPrice: sdk.MustNewDecFromStr("0.1"), - SellingCoin: sdk.NewInt64Coin("denomc", 5000000000), - PayingCoinDenom: "denomd", - MaxExtendedRound: 3, - ExtendedRoundRate: sdk.MustNewDecFromStr("0.1"), - VestingSchedules: []types.VestingSchedule{}, - StartTime: ctx.BlockTime(), - EndTime: ctx.BlockTime().AddDate(0, 1, 0), - }) - require.NoError(t, err) - - op := simulation.SimulateMsgPlaceBid(app.AccountKeeper, app.BankKeeper, app.FundraisingKeeper) - opMsg, futureOps, err := op(r, app.BaseApp, ctx, accounts, "") - require.NoError(t, err) - require.True(t, opMsg.OK) - require.Len(t, futureOps, 0) - - var msg types.MsgPlaceBid - types.ModuleCdc.MustUnmarshalJSON(opMsg.Msg, &msg) - - require.Equal(t, types.TypeMsgPlaceBid, msg.Type()) - require.Equal(t, types.ModuleName, msg.Route()) - require.Equal(t, "cosmos1tnh2q55v8wyygtt9srz5safamzdengsnqeycj3", msg.Bidder) - require.Equal(t, uint64(2), msg.AuctionId) - require.Equal(t, types.BidTypeBatchWorth, msg.BidType) - require.Equal(t, sdk.MustNewDecFromStr("0.8"), msg.Price) - require.Equal(t, sdk.NewInt64Coin("denomd", 336222540), msg.Coin) -} - -func createTestApp(isCheckTx bool) (*chain.App, string, sdk.Context) { - var ( - chainID = "chain-" + tmrand.NewRand().Str(6) - app = simapp.New(chainID, chain.DefaultNodeHome) - ctx = app.BaseApp.NewContext(isCheckTx, tmproto.Header{ - ChainID: chainID, - }) - ) - ctx.WithChainID(chainID) - _ = app.MintKeeper.SetParams(ctx, minttypes.DefaultParams()) - return app, chainID, ctx -} - -func getTestingAccounts(t *testing.T, r *rand.Rand, app *chain.App, ctx sdk.Context, n int) []simtypes.Account { - accs := simtypes.RandomAccounts(r, n) - - initAmt := app.StakingKeeper.TokensFromConsensusPower(ctx, 500) - coins := sdk.NewCoins( - sdk.NewCoin(sdk.DefaultBondDenom, initAmt), - sdk.NewInt64Coin("denoma", 1_000_000_000_000_000), - sdk.NewInt64Coin("denomb", 1_000_000_000_000_000), - sdk.NewInt64Coin("denomc", 1_000_000_000_000_000), - sdk.NewInt64Coin("denomd", 1_000_000_000_000_000), - ) - - // add coins to the accounts - for _, acc := range accs { - acc := app.AccountKeeper.NewAccountWithAddress(ctx, acc.Address) - app.AccountKeeper.SetAccount(ctx, acc) - - err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, coins) - require.NoError(t, err) - - err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, acc.GetAddress(), coins) - require.NoError(t, err) - } - - return accs -} diff --git a/x/fundraising/simulation/params.go b/x/fundraising/simulation/params.go deleted file mode 100644 index f369cd16..00000000 --- a/x/fundraising/simulation/params.go +++ /dev/null @@ -1,34 +0,0 @@ -package simulation - -// DONTCOVER - -import ( - "fmt" - "math/rand" - - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - - "github.com/tendermint/fundraising/x/fundraising/types" -) - -// ParamChanges defines the parameters that can be modified by param change proposals. -// on the simulation. -func ParamChanges(r *rand.Rand) []simtypes.LegacyParamChange { - return []simtypes.LegacyParamChange{ - simulation.NewSimLegacyParamChange(types.ModuleName, string(types.KeyAuctionCreationFee), - func(r *rand.Rand) string { - bz, err := GenAuctionCreationFee(r).MarshalJSON() - if err != nil { - panic(err) - } - return string(bz) - }, - ), - simulation.NewSimLegacyParamChange(types.ModuleName, string(types.KeyExtendedPeriod), - func(r *rand.Rand) string { - return fmt.Sprintf("%d", GenExtendedPeriod(r)) - }, - ), - } -} diff --git a/x/fundraising/simulation/params_test.go b/x/fundraising/simulation/params_test.go deleted file mode 100644 index 4b68ebee..00000000 --- a/x/fundraising/simulation/params_test.go +++ /dev/null @@ -1,35 +0,0 @@ -package simulation_test - -import ( - "math/rand" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/tendermint/fundraising/x/fundraising/simulation" -) - -func TestParamChanges(t *testing.T) { - s := rand.NewSource(1) - r := rand.New(s) - - expected := []struct { - composedKey string - key string - simValue string - subspace string - }{ - {"fundraising/AuctionCreationFee", "AuctionCreationFee", "[{\"denom\":\"stake\",\"amount\":\"98498081\"}]", "fundraising"}, - {"fundraising/ExtendedPeriod", "ExtendedPeriod", "7", "fundraising"}, - } - - paramChanges := simulation.ParamChanges(r) - require.Len(t, paramChanges, 2) - - for i, p := range paramChanges { - require.Equal(t, expected[i].composedKey, p.ComposedKey()) - require.Equal(t, expected[i].key, p.Key()) - require.Equal(t, expected[i].simValue, p.SimValue()(r)) - require.Equal(t, expected[i].subspace, p.Subspace()) - } -} diff --git a/x/fundraising/simulation/place_bid.go b/x/fundraising/simulation/place_bid.go new file mode 100644 index 00000000..679ba311 --- /dev/null +++ b/x/fundraising/simulation/place_bid.go @@ -0,0 +1,120 @@ +package simulation + +import ( + "math/rand" + + "cosmossdk.io/collections" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + + "github.com/tendermint/fundraising/x/fundraising/keeper" + "github.com/tendermint/fundraising/x/fundraising/types" +) + +// SimulateMsgPlaceBid generates a MsgPlaceBid with random values +// nolint: interfacer +func SimulateMsgPlaceBid( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, + txGen client.TxConfig, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + msg := &types.MsgPlaceBid{} + auctions, err := k.Auctions(ctx) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "failed to get auctions"), nil, nil + } + + if len(auctions) == 0 { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "no auction to place a bid"), nil, nil + } + + // Select a random auction + auction := auctions[r.Intn(len(auctions))] + + if auction.GetStatus() != types.AuctionStatusStarted { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "auction must be started status"), nil, nil + } + + simAccount, _ := simtypes.RandomAcc(r, accs) + + account := ak.GetAccount(ctx, simAccount.Address) + spendable := bk.SpendableCoins(ctx, account.GetAddress()) + + bidder := account.GetAddress() + sellingCoinDenom := auction.GetSellingCoin().Denom + payingCoinDenom := auction.GetPayingCoinDenom() + + if _, err := fundBalances(ctx, r, bk, bidder, testCoinDenoms); err != nil { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "failed to fund bidder"), nil, err + } + + var bid types.Bid + switch auction.GetType() { + case types.AuctionTypeFixedPrice: + bid.Type = types.BidTypeFixedPrice + bid.Price = auction.GetStartPrice() + if r.Int()%2 == 0 { + bid.Coin = sdk.NewInt64Coin(payingCoinDenom, int64(simtypes.RandIntBetween(r, 100000, 1000000000))) + } else { + bid.Coin = sdk.NewInt64Coin(sellingCoinDenom, int64(simtypes.RandIntBetween(r, 100000, 1000000000))) + } + case types.AuctionTypeBatch: + bid.Price = auction.GetStartPrice().Add(math.LegacyNewDecWithPrec(int64(simtypes.RandIntBetween(r, 1, 5)), 1)) // StartPrice + 0.1 ~ 0.5 + if r.Int()%2 == 0 { + bid.Type = types.BidTypeBatchWorth + bid.Coin = sdk.NewInt64Coin(payingCoinDenom, int64(simtypes.RandIntBetween(r, 100000, 1000000000))) + } else { + bid.Type = types.BidTypeBatchMany + bid.Coin = sdk.NewInt64Coin(sellingCoinDenom, int64(simtypes.RandIntBetween(r, 100000, 1000000000))) + } + } + + bidReserveAmt := bid.ConvertToPayingAmount(payingCoinDenom) + maxBidAmt := bid.ConvertToSellingAmount(payingCoinDenom) + + if !bk.SpendableCoins(ctx, bidder).AmountOf(payingCoinDenom).GT(bidReserveAmt) { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "insufficient balance to place a bid"), nil, nil + } + + allowedBidder, err := k.AllowedBidder.Get(ctx, collections.Join(auction.GetId(), bidder)) + if err == nil { + maxBidAmt = maxBidAmt.Add(allowedBidder.MaxBidAmount) + } + + newAllowedBidder := types.NewAllowedBidder(auction.GetId(), bidder, maxBidAmt) + if err := k.AddAllowedBidders(ctx, auction.GetId(), []types.AllowedBidder{newAllowedBidder}); err != nil { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "failed to add allowed bidders"), nil, nil + } + + msg = types.NewMsgPlaceBid( + auction.GetId(), + bidder.String(), + bid.Type, + bid.Price, + bid.Coin, + ) + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: txGen, + Cdc: nil, + Msg: msg, + Context: ctx, + SimAccount: simAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendable, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} diff --git a/x/fundraising/types/allowed_bidder.go b/x/fundraising/types/allowed_bidder.go index 61b5044d..e5077d15 100644 --- a/x/fundraising/types/allowed_bidder.go +++ b/x/fundraising/types/allowed_bidder.go @@ -1,14 +1,16 @@ package types import ( + sdkerrors "cosmossdk.io/errors" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/errors" ) // NewAllowedBidder returns a new AllowedBidder. -func NewAllowedBidder(bidderAddr sdk.AccAddress, maxBidAmount math.Int) AllowedBidder { +func NewAllowedBidder(auctionId uint64, bidderAddr sdk.AccAddress, maxBidAmount math.Int) AllowedBidder { return AllowedBidder{ + AuctionId: auctionId, Bidder: bidderAddr.String(), MaxBidAmount: maxBidAmount, } @@ -26,7 +28,7 @@ func (ab AllowedBidder) GetBidder() sdk.AccAddress { // Validate validates allowed bidder object. func (ab AllowedBidder) Validate() error { if _, err := sdk.AccAddressFromBech32(ab.Bidder); err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, err.Error()) + return sdkerrors.Wrap(errors.ErrInvalidAddress, err.Error()) } if ab.MaxBidAmount.IsNil() { return ErrInvalidMaxBidAmount diff --git a/x/fundraising/types/allowed_bidder.pb.go b/x/fundraising/types/allowed_bidder.pb.go new file mode 100644 index 00000000..22a61752 --- /dev/null +++ b/x/fundraising/types/allowed_bidder.pb.go @@ -0,0 +1,400 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fundraising/fundraising/v1/allowed_bidder.proto + +package types + +import ( + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// AllowedBidder defines an allowed bidder for the auction. +type AllowedBidder struct { + // auction_id specifies the id of the auction + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + // bidder specifies the bech32-encoded address that bids for the auction + Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` + // max_bid_amount specifies the maximum bid amount that the bidder can bid + MaxBidAmount cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=max_bid_amount,json=maxBidAmount,proto3,customtype=cosmossdk.io/math.Int" json:"max_bid_amount"` +} + +func (m *AllowedBidder) Reset() { *m = AllowedBidder{} } +func (m *AllowedBidder) String() string { return proto.CompactTextString(m) } +func (*AllowedBidder) ProtoMessage() {} +func (*AllowedBidder) Descriptor() ([]byte, []int) { + return fileDescriptor_5e8398328c34706b, []int{0} +} +func (m *AllowedBidder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AllowedBidder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AllowedBidder.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 *AllowedBidder) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllowedBidder.Merge(m, src) +} +func (m *AllowedBidder) XXX_Size() int { + return m.Size() +} +func (m *AllowedBidder) XXX_DiscardUnknown() { + xxx_messageInfo_AllowedBidder.DiscardUnknown(m) +} + +var xxx_messageInfo_AllowedBidder proto.InternalMessageInfo + +func init() { + proto.RegisterType((*AllowedBidder)(nil), "fundraising.fundraising.v1.AllowedBidder") +} + +func init() { + proto.RegisterFile("fundraising/fundraising/v1/allowed_bidder.proto", fileDescriptor_5e8398328c34706b) +} + +var fileDescriptor_5e8398328c34706b = []byte{ + // 291 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4f, 0x2b, 0xcd, 0x4b, + 0x29, 0x4a, 0xcc, 0x2c, 0xce, 0xcc, 0x4b, 0x47, 0x61, 0x97, 0x19, 0xea, 0x27, 0xe6, 0xe4, 0xe4, + 0x97, 0xa7, 0xa6, 0xc4, 0x27, 0x65, 0xa6, 0xa4, 0xa4, 0x16, 0xe9, 0x15, 0x14, 0xe5, 0x97, 0xe4, + 0x0b, 0x49, 0x21, 0x29, 0xd2, 0x43, 0x66, 0x97, 0x19, 0x4a, 0x49, 0x26, 0xe7, 0x17, 0xe7, 0xe6, + 0x17, 0xc7, 0x83, 0x55, 0xea, 0x43, 0x38, 0x10, 0x6d, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x10, + 0x71, 0x10, 0x0b, 0x22, 0xaa, 0x34, 0x9f, 0x91, 0x8b, 0xd7, 0x11, 0x62, 0x8b, 0x13, 0xd8, 0x12, + 0x21, 0x59, 0x2e, 0xae, 0xc4, 0xd2, 0xe4, 0x92, 0xcc, 0xfc, 0xbc, 0xf8, 0xcc, 0x14, 0x09, 0x46, + 0x05, 0x46, 0x0d, 0x96, 0x20, 0x4e, 0xa8, 0x88, 0x67, 0x8a, 0x90, 0x18, 0x17, 0x1b, 0xc4, 0x35, + 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x50, 0x9e, 0x50, 0x20, 0x17, 0x5f, 0x6e, 0x62, 0x05, + 0xc8, 0xa5, 0xf1, 0x89, 0xb9, 0xf9, 0xa5, 0x79, 0x25, 0x12, 0xcc, 0x20, 0x79, 0x27, 0xed, 0x13, + 0xf7, 0xe4, 0x19, 0x6e, 0xdd, 0x93, 0x17, 0x85, 0x38, 0xa6, 0x38, 0x25, 0x5b, 0x2f, 0x33, 0x5f, + 0x3f, 0x37, 0xb1, 0x24, 0x43, 0xcf, 0x33, 0xaf, 0xe4, 0xd2, 0x16, 0x5d, 0x2e, 0xa8, 0x2b, 0x3d, + 0xf3, 0x4a, 0x82, 0x78, 0x72, 0x13, 0x2b, 0x9c, 0x32, 0x53, 0x1c, 0xc1, 0x06, 0x58, 0xb1, 0x74, + 0x2c, 0x90, 0x67, 0x70, 0xf2, 0x3f, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, + 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, + 0xd3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0x92, 0xd4, 0xbc, 0x94, + 0xd4, 0xa2, 0xdc, 0xcc, 0xbc, 0x12, 0x94, 0x30, 0xac, 0x40, 0xe1, 0x95, 0x54, 0x16, 0xa4, 0x16, + 0x27, 0xb1, 0x81, 0x7d, 0x6e, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x40, 0xf3, 0xdd, 0x79, + 0x01, 0x00, 0x00, +} + +func (m *AllowedBidder) 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 *AllowedBidder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AllowedBidder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.MaxBidAmount.Size() + i -= size + if _, err := m.MaxBidAmount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAllowedBidder(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintAllowedBidder(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x12 + } + if m.AuctionId != 0 { + i = encodeVarintAllowedBidder(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintAllowedBidder(dAtA []byte, offset int, v uint64) int { + offset -= sovAllowedBidder(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AllowedBidder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovAllowedBidder(uint64(m.AuctionId)) + } + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovAllowedBidder(uint64(l)) + } + l = m.MaxBidAmount.Size() + n += 1 + l + sovAllowedBidder(uint64(l)) + return n +} + +func sovAllowedBidder(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAllowedBidder(x uint64) (n int) { + return sovAllowedBidder(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *AllowedBidder) 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 ErrIntOverflowAllowedBidder + } + 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: AllowedBidder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllowedBidder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAllowedBidder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAllowedBidder + } + 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 ErrInvalidLengthAllowedBidder + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAllowedBidder + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxBidAmount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAllowedBidder + } + 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 ErrInvalidLengthAllowedBidder + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAllowedBidder + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxBidAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAllowedBidder(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAllowedBidder + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAllowedBidder(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, ErrIntOverflowAllowedBidder + } + 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, ErrIntOverflowAllowedBidder + } + 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, ErrIntOverflowAllowedBidder + } + 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, ErrInvalidLengthAllowedBidder + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAllowedBidder + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAllowedBidder + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAllowedBidder = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAllowedBidder = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAllowedBidder = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/fundraising/types/allowed_bidder_test.go b/x/fundraising/types/allowed_bidder_test.go index c675b182..bc5f9537 100644 --- a/x/fundraising/types/allowed_bidder_test.go +++ b/x/fundraising/types/allowed_bidder_test.go @@ -3,6 +3,7 @@ package types_test import ( "testing" + "cosmossdk.io/math" "github.com/cometbft/cometbft/crypto" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -18,19 +19,19 @@ func TestValidate_AllowedBidder(t *testing.T) { expectedErr bool }{ { - types.NewAllowedBidder(testBidderAddr, sdk.NewInt(100_000_000)), + types.NewAllowedBidder(1, testBidderAddr, math.NewInt(100_000_000)), false, }, { - types.NewAllowedBidder(sdk.AccAddress{}, sdk.NewInt(100_000_000)), + types.NewAllowedBidder(1, sdk.AccAddress{}, math.NewInt(100_000_000)), true, }, { - types.NewAllowedBidder(testBidderAddr, sdk.NewInt(0)), + types.NewAllowedBidder(1, testBidderAddr, math.NewInt(0)), true, }, { - types.NewAllowedBidder(testBidderAddr, sdk.ZeroInt()), + types.NewAllowedBidder(1, testBidderAddr, math.ZeroInt()), true, }, } diff --git a/x/fundraising/types/auction.go b/x/fundraising/types/auction.go index c3527f41..ee084630 100644 --- a/x/fundraising/types/auction.go +++ b/x/fundraising/types/auction.go @@ -4,12 +4,13 @@ import ( "fmt" "time" - "github.com/gogo/protobuf/proto" - + sdkerrors "cosmossdk.io/errors" + "cosmossdk.io/math" "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" + "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/gogo/protobuf/proto" ) const ( @@ -34,7 +35,7 @@ var ( func NewBaseAuction( id uint64, typ AuctionType, auctioneerAddr string, sellingPoolAddr string, payingPoolAddr string, - startPrice sdk.Dec, sellingCoin sdk.Coin, payingCoinDenom string, + startPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingPoolAddr string, vestingSchedules []VestingSchedule, startTime time.Time, endTimes []time.Time, status AuctionStatus, ) *BaseAuction { @@ -112,11 +113,11 @@ func (ba *BaseAuction) SetPayingReserveAddress(addr sdk.AccAddress) error { return nil } -func (ba BaseAuction) GetStartPrice() sdk.Dec { +func (ba BaseAuction) GetStartPrice() math.LegacyDec { return ba.StartPrice } -func (ba *BaseAuction) SetStartPrice(price sdk.Dec) error { +func (ba *BaseAuction) SetStartPrice(price math.LegacyDec) error { ba.StartPrice = price return nil } @@ -194,28 +195,28 @@ func (ba BaseAuction) Validate() error { return sdkerrors.Wrapf(ErrInvalidAuctionType, "unknown plan type: %s", ba.Type) } if _, err := sdk.AccAddressFromBech32(ba.Auctioneer); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid auctioneer address %q: %v", ba.Auctioneer, err) + return sdkerrors.Wrapf(errors.ErrInvalidAddress, "invalid auctioneer address %q: %v", ba.Auctioneer, err) } if _, err := sdk.AccAddressFromBech32(ba.SellingReserveAddress); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid selling pool address %q: %v", ba.SellingReserveAddress, err) + return sdkerrors.Wrapf(errors.ErrInvalidAddress, "invalid selling pool address %q: %v", ba.SellingReserveAddress, err) } if _, err := sdk.AccAddressFromBech32(ba.PayingReserveAddress); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid paying pool address %q: %v", ba.PayingReserveAddress, err) + return sdkerrors.Wrapf(errors.ErrInvalidAddress, "invalid paying pool address %q: %v", ba.PayingReserveAddress, err) } if _, err := sdk.AccAddressFromBech32(ba.VestingReserveAddress); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid vesting pool address %q: %v", ba.VestingReserveAddress, err) + return sdkerrors.Wrapf(errors.ErrInvalidAddress, "invalid vesting pool address %q: %v", ba.VestingReserveAddress, err) } if !ba.StartPrice.IsPositive() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid start price: %f", ba.StartPrice) + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "invalid start price: %f", ba.StartPrice) } if err := ba.SellingCoin.Validate(); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidCoins, "invalid selling coin: %v", ba.SellingCoin) + return sdkerrors.Wrapf(errors.ErrInvalidCoins, "invalid selling coin: %v", ba.SellingCoin) } if ba.SellingCoin.Denom == ba.PayingCoinDenom { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "selling coin denom must not be the same as paying coin denom") + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "selling coin denom must not be the same as paying coin denom") } if err := sdk.ValidateDenom(ba.PayingCoinDenom); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid paying coin denom: %v", err) + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "invalid paying coin denom: %v", err) } if err := ValidateVestingSchedules(ba.VestingSchedules, ba.EndTimes[len(ba.EndTimes)-1]); err != nil { return err @@ -243,7 +244,7 @@ func NewFixedPriceAuction(baseAuction *BaseAuction, remainingSellingCoin sdk.Coi } // NewBatchAuction returns a new batch auction. -func NewBatchAuction(baseAuction *BaseAuction, minBidPrice sdk.Dec, matchedPrice sdk.Dec, maxExtendedRound uint32, extendedRoundRate sdk.Dec) *BatchAuction { +func NewBatchAuction(baseAuction *BaseAuction, minBidPrice math.LegacyDec, matchedPrice math.LegacyDec, maxExtendedRound uint32, extendedRoundRate math.LegacyDec) *BatchAuction { return &BatchAuction{ BaseAuction: baseAuction, MinBidPrice: minBidPrice, @@ -273,8 +274,8 @@ type AuctionI interface { GetPayingReserveAddress() sdk.AccAddress SetPayingReserveAddress(sdk.AccAddress) error - GetStartPrice() sdk.Dec - SetStartPrice(sdk.Dec) error + GetStartPrice() math.LegacyDec + SetStartPrice(math.LegacyDec) error GetSellingCoin() sdk.Coin SetSellingCoin(sdk.Coin) error @@ -315,11 +316,11 @@ func PackAuction(auction AuctionI) (*codectypes.Any, error) { // UnpackAuction converts Any to AuctionI. func UnpackAuction(any *codectypes.Any) (AuctionI, error) { if any == nil { - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "cannot unpack nil") + return nil, sdkerrors.Wrapf(errors.ErrInvalidType, "cannot unpack nil") } if any.TypeUrl == "" { - return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidType, "empty type url") + return nil, sdkerrors.Wrap(errors.ErrInvalidType, "empty type url") } var auction AuctionI @@ -335,7 +336,7 @@ func UnpackAuction(any *codectypes.Any) (AuctionI, error) { auction, ok := v.(AuctionI) if !ok { - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "cannot unpack auction from %T", v) + return nil, sdkerrors.Wrapf(errors.ErrInvalidType, "cannot unpack auction from %T", v) } return auction, nil diff --git a/x/fundraising/types/auction.pb.go b/x/fundraising/types/auction.pb.go new file mode 100644 index 00000000..6883aaed --- /dev/null +++ b/x/fundraising/types/auction.pb.go @@ -0,0 +1,1777 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fundraising/fundraising/v1/auction.proto + +package types + +import ( + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + 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" + 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. +// 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 + +// AuctionType enumerates the valid types of an auction. +type AuctionType int32 + +const ( + // AUCTION_TYPE_UNSPECIFIED defines the default auction type + AuctionTypeNil AuctionType = 0 + // AUCTION_TYPE_FIXED_PRICE defines the fixed price auction type + AuctionTypeFixedPrice AuctionType = 1 + // AUCTION_TYPE_BATCH defines the batch auction type + AuctionTypeBatch AuctionType = 2 +) + +var AuctionType_name = map[int32]string{ + 0: "AUCTION_TYPE_UNSPECIFIED", + 1: "AUCTION_TYPE_FIXED_PRICE", + 2: "AUCTION_TYPE_BATCH", +} + +var AuctionType_value = map[string]int32{ + "AUCTION_TYPE_UNSPECIFIED": 0, + "AUCTION_TYPE_FIXED_PRICE": 1, + "AUCTION_TYPE_BATCH": 2, +} + +func (x AuctionType) String() string { + return proto.EnumName(AuctionType_name, int32(x)) +} + +func (AuctionType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_807e2fa5734d5f53, []int{0} +} + +// AuctionStatus enumerates the valid status of an auction. +type AuctionStatus int32 + +const ( + // AUCTION_STATUS_UNSPECIFIED defines the default auction status + AuctionStatusNil AuctionStatus = 0 + // AUCTION_STATUS_STANDBY defines the standby auction status + AuctionStatusStandBy AuctionStatus = 1 + // AUCTION_STATUS_STARTED defines the started auction status + AuctionStatusStarted AuctionStatus = 2 + // AUCTION_STATUS_VESTING defines the vesting auction status + AuctionStatusVesting AuctionStatus = 3 + // AUCTION_STATUS_FINISHED defines the finished auction status + AuctionStatusFinished AuctionStatus = 4 + // AUCTION_STATUS_CANCELLED defines the cancelled auction status + AuctionStatusCancelled AuctionStatus = 5 +) + +var AuctionStatus_name = map[int32]string{ + 0: "AUCTION_STATUS_UNSPECIFIED", + 1: "AUCTION_STATUS_STANDBY", + 2: "AUCTION_STATUS_STARTED", + 3: "AUCTION_STATUS_VESTING", + 4: "AUCTION_STATUS_FINISHED", + 5: "AUCTION_STATUS_CANCELLED", +} + +var AuctionStatus_value = map[string]int32{ + "AUCTION_STATUS_UNSPECIFIED": 0, + "AUCTION_STATUS_STANDBY": 1, + "AUCTION_STATUS_STARTED": 2, + "AUCTION_STATUS_VESTING": 3, + "AUCTION_STATUS_FINISHED": 4, + "AUCTION_STATUS_CANCELLED": 5, +} + +func (x AuctionStatus) String() string { + return proto.EnumName(AuctionStatus_name, int32(x)) +} + +func (AuctionStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_807e2fa5734d5f53, []int{1} +} + +// BaseAuction defines a base auction type. It contains all the necessary fields +// for basic auction functionality. Any custom auction type should extend this +// type for additional functionality (e.g. batch auction, fixed price +// auction). +type BaseAuction struct { + // id specifies index of the auction + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // type specifies the auction type + // type 1 is fixed price and 2 is batch auction + Type AuctionType `protobuf:"varint,2,opt,name=type,proto3,enum=fundraising.fundraising.v1.AuctionType" json:"type,omitempty"` + // auctioneer specifies the bech32-encoded address that creates the auction + Auctioneer string `protobuf:"bytes,3,opt,name=auctioneer,proto3" json:"auctioneer,omitempty"` + // selling_reserve_address specifies the bech32-encoded address that has all + // the selling coin + SellingReserveAddress string `protobuf:"bytes,4,opt,name=selling_reserve_address,json=sellingReserveAddress,proto3" json:"selling_reserve_address,omitempty"` + // paying_reserve_address specifies the bech32-encoded address that has all + // the paying coin + PayingReserveAddress string `protobuf:"bytes,5,opt,name=paying_reserve_address,json=payingReserveAddress,proto3" json:"paying_reserve_address,omitempty"` + // start_price specifies the starting price of the auction + // it is determined by the proportion of the price of paying coin denom + StartPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=start_price,json=startPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"start_price"` + // selling_coin specifies the selling coin for the auction + SellingCoin types.Coin `protobuf:"bytes,7,opt,name=selling_coin,json=sellingCoin,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"selling_coin"` + // paying_coin_denom specifies the paying coin denom that bidders use to bid + // for + PayingCoinDenom string `protobuf:"bytes,8,opt,name=paying_coin_denom,json=payingCoinDenom,proto3" json:"paying_coin_denom,omitempty"` + // vesting_reserve_address specifies the bech32-encoded vesting address that + // holds vesting amounts of coin + VestingReserveAddress string `protobuf:"bytes,9,opt,name=vesting_reserve_address,json=vestingReserveAddress,proto3" json:"vesting_reserve_address,omitempty"` + // vesting_schedules specifies the vesting schedules for the auction + VestingSchedules []VestingSchedule `protobuf:"bytes,10,rep,name=vesting_schedules,json=vestingSchedules,proto3" json:"vesting_schedules"` + // start_time specifies the start time of the plan + StartTime time.Time `protobuf:"bytes,11,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"` + // end_times specifies the end time of the plan + EndTimes []time.Time `protobuf:"bytes,12,rep,name=end_times,json=endTimes,proto3,stdtime" json:"end_times"` + // status specifies the auction status + Status AuctionStatus `protobuf:"varint,13,opt,name=status,proto3,enum=fundraising.fundraising.v1.AuctionStatus" json:"status,omitempty"` +} + +func (m *BaseAuction) Reset() { *m = BaseAuction{} } +func (m *BaseAuction) String() string { return proto.CompactTextString(m) } +func (*BaseAuction) ProtoMessage() {} +func (*BaseAuction) Descriptor() ([]byte, []int) { + return fileDescriptor_807e2fa5734d5f53, []int{0} +} +func (m *BaseAuction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BaseAuction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BaseAuction.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 *BaseAuction) XXX_Merge(src proto.Message) { + xxx_messageInfo_BaseAuction.Merge(m, src) +} +func (m *BaseAuction) XXX_Size() int { + return m.Size() +} +func (m *BaseAuction) XXX_DiscardUnknown() { + xxx_messageInfo_BaseAuction.DiscardUnknown(m) +} + +var xxx_messageInfo_BaseAuction proto.InternalMessageInfo + +// FixedPriceAuction defines the fixed price auction type. It is the most +// simpliest way to raise funds. An auctioneer sets the starting price for each +// selling amounts of coin and bidders bid to purchase based on the fixed price. +type FixedPriceAuction struct { + *BaseAuction `protobuf:"bytes,1,opt,name=base_auction,json=baseAuction,proto3,embedded=base_auction" json:"base_auction,omitempty"` + // remaining_coin specifies the remaining amount of selling coin to sell + RemainingSellingCoin types.Coin `protobuf:"bytes,2,opt,name=remaining_selling_coin,json=remainingSellingCoin,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"remaining_selling_coin"` +} + +func (m *FixedPriceAuction) Reset() { *m = FixedPriceAuction{} } +func (m *FixedPriceAuction) String() string { return proto.CompactTextString(m) } +func (*FixedPriceAuction) ProtoMessage() {} +func (*FixedPriceAuction) Descriptor() ([]byte, []int) { + return fileDescriptor_807e2fa5734d5f53, []int{1} +} +func (m *FixedPriceAuction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FixedPriceAuction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FixedPriceAuction.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 *FixedPriceAuction) XXX_Merge(src proto.Message) { + xxx_messageInfo_FixedPriceAuction.Merge(m, src) +} +func (m *FixedPriceAuction) XXX_Size() int { + return m.Size() +} +func (m *FixedPriceAuction) XXX_DiscardUnknown() { + xxx_messageInfo_FixedPriceAuction.DiscardUnknown(m) +} + +var xxx_messageInfo_FixedPriceAuction proto.InternalMessageInfo + +// BatchAuction defines a batch auction type. It allows bidders to participate +// in the auction by placing their limit orders with a bid price they are +// willing to bid within the auction period. They can place multiple bids with +// different bid prices and if they want to modify their existing bid, they only +// have an option to modify with a higher bid price. Under the hood, an order +// book is created to record the bids to calculate the matched bidders. +type BatchAuction struct { + *BaseAuction `protobuf:"bytes,1,opt,name=base_auction,json=baseAuction,proto3,embedded=base_auction" json:"base_auction,omitempty"` + // min_bid_price specifies the minibum bid price + MinBidPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=min_bid_price,json=minBidPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_bid_price"` + // matched_price specifies the matched price of the auction + MatchedPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=matched_price,json=matchedPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"matched_price"` + // max_extended_round specifies a maximum number of extended rounds + MaxExtendedRound uint32 `protobuf:"varint,4,opt,name=max_extended_round,json=maxExtendedRound,proto3" json:"max_extended_round,omitempty"` + // extended_round_rate specifies the rate that decides if the auction needs + // another round + ExtendedRoundRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=extended_round_rate,json=extendedRoundRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"extended_round_rate"` +} + +func (m *BatchAuction) Reset() { *m = BatchAuction{} } +func (m *BatchAuction) String() string { return proto.CompactTextString(m) } +func (*BatchAuction) ProtoMessage() {} +func (*BatchAuction) Descriptor() ([]byte, []int) { + return fileDescriptor_807e2fa5734d5f53, []int{2} +} +func (m *BatchAuction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BatchAuction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BatchAuction.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 *BatchAuction) XXX_Merge(src proto.Message) { + xxx_messageInfo_BatchAuction.Merge(m, src) +} +func (m *BatchAuction) XXX_Size() int { + return m.Size() +} +func (m *BatchAuction) XXX_DiscardUnknown() { + xxx_messageInfo_BatchAuction.DiscardUnknown(m) +} + +var xxx_messageInfo_BatchAuction proto.InternalMessageInfo + +// VestingSchedule defines the vesting schedule for the owner of an auction. +type VestingSchedule struct { + // release_time specifies the time for distribution of the vesting coin + ReleaseTime time.Time `protobuf:"bytes,1,opt,name=release_time,json=releaseTime,proto3,stdtime" json:"release_time"` + // weight specifies the vesting weight for the schedule + Weight cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=weight,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"weight"` +} + +func (m *VestingSchedule) Reset() { *m = VestingSchedule{} } +func (m *VestingSchedule) String() string { return proto.CompactTextString(m) } +func (*VestingSchedule) ProtoMessage() {} +func (*VestingSchedule) Descriptor() ([]byte, []int) { + return fileDescriptor_807e2fa5734d5f53, []int{3} +} +func (m *VestingSchedule) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VestingSchedule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VestingSchedule.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 *VestingSchedule) XXX_Merge(src proto.Message) { + xxx_messageInfo_VestingSchedule.Merge(m, src) +} +func (m *VestingSchedule) XXX_Size() int { + return m.Size() +} +func (m *VestingSchedule) XXX_DiscardUnknown() { + xxx_messageInfo_VestingSchedule.DiscardUnknown(m) +} + +var xxx_messageInfo_VestingSchedule proto.InternalMessageInfo + +func (m *VestingSchedule) GetReleaseTime() time.Time { + if m != nil { + return m.ReleaseTime + } + return time.Time{} +} + +func init() { + proto.RegisterEnum("fundraising.fundraising.v1.AuctionType", AuctionType_name, AuctionType_value) + proto.RegisterEnum("fundraising.fundraising.v1.AuctionStatus", AuctionStatus_name, AuctionStatus_value) + proto.RegisterType((*BaseAuction)(nil), "fundraising.fundraising.v1.BaseAuction") + proto.RegisterType((*FixedPriceAuction)(nil), "fundraising.fundraising.v1.FixedPriceAuction") + proto.RegisterType((*BatchAuction)(nil), "fundraising.fundraising.v1.BatchAuction") + proto.RegisterType((*VestingSchedule)(nil), "fundraising.fundraising.v1.VestingSchedule") +} + +func init() { + proto.RegisterFile("fundraising/fundraising/v1/auction.proto", fileDescriptor_807e2fa5734d5f53) +} + +var fileDescriptor_807e2fa5734d5f53 = []byte{ + // 1093 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xbf, 0x6f, 0xdb, 0x46, + 0x14, 0x16, 0x65, 0xc5, 0xb5, 0x8f, 0xb2, 0x43, 0xb3, 0x8e, 0x4b, 0xb3, 0x80, 0x24, 0x78, 0x89, + 0xea, 0xd6, 0x64, 0xed, 0xba, 0x3f, 0x90, 0x4e, 0xa2, 0x44, 0x27, 0x02, 0x0c, 0xc5, 0xa0, 0x64, + 0xa3, 0xe9, 0x50, 0xe2, 0x44, 0x5e, 0xa4, 0x43, 0x44, 0x52, 0xe0, 0x51, 0xaa, 0xbd, 0x15, 0xe8, + 0x12, 0x78, 0xca, 0x5c, 0xc0, 0x40, 0x81, 0xa2, 0x45, 0x51, 0x74, 0xc8, 0x90, 0x3f, 0x22, 0xe8, + 0x64, 0x74, 0x2a, 0x3a, 0xd8, 0x85, 0x3d, 0x64, 0xeb, 0xdf, 0x50, 0xdc, 0x0f, 0xd5, 0x94, 0xa0, + 0xa6, 0x89, 0x81, 0x2c, 0x36, 0x79, 0xef, 0x7d, 0xdf, 0xbd, 0xfb, 0xde, 0xf7, 0x8e, 0x02, 0xe5, + 0x87, 0x83, 0xd0, 0x8f, 0x21, 0x26, 0x38, 0xec, 0x98, 0xe9, 0xe7, 0xe1, 0xa6, 0x09, 0x07, 0x5e, + 0x82, 0xa3, 0xd0, 0xe8, 0xc7, 0x51, 0x12, 0xa9, 0x7a, 0x2a, 0x6a, 0xa4, 0x9f, 0x87, 0x9b, 0xfa, + 0x12, 0x0c, 0x70, 0x18, 0x99, 0xec, 0x2f, 0x4f, 0xd7, 0x0b, 0x5e, 0x44, 0x82, 0x88, 0x98, 0x6d, + 0x48, 0x90, 0x39, 0xdc, 0x6c, 0xa3, 0x04, 0x6e, 0x9a, 0x5e, 0x84, 0x05, 0x9d, 0xbe, 0xca, 0xe3, + 0x2e, 0x7b, 0x33, 0xf9, 0x8b, 0x08, 0x2d, 0x77, 0xa2, 0x4e, 0xc4, 0xd7, 0xe9, 0x93, 0x58, 0x2d, + 0x76, 0xa2, 0xa8, 0xd3, 0x43, 0x26, 0x7b, 0x6b, 0x0f, 0x1e, 0x9a, 0x09, 0x0e, 0x10, 0x49, 0x60, + 0xd0, 0xe7, 0x09, 0x6b, 0x97, 0xb3, 0x40, 0xb6, 0x20, 0x41, 0x15, 0x5e, 0xb6, 0xba, 0x08, 0xb2, + 0xd8, 0xd7, 0xa4, 0x92, 0x54, 0xce, 0x39, 0x59, 0xec, 0xab, 0x9f, 0x83, 0x5c, 0x72, 0xd4, 0x47, + 0x5a, 0xb6, 0x24, 0x95, 0x17, 0xb7, 0x6e, 0x1b, 0xff, 0x7d, 0x1e, 0x43, 0x50, 0xb4, 0x8e, 0xfa, + 0xc8, 0x61, 0x20, 0xb5, 0x00, 0x80, 0x90, 0x03, 0xa1, 0x58, 0x9b, 0x29, 0x49, 0xe5, 0x79, 0x27, + 0xb5, 0xa2, 0x7e, 0x02, 0xde, 0x21, 0xa8, 0xd7, 0xc3, 0x61, 0xc7, 0x8d, 0x11, 0x41, 0xf1, 0x10, + 0xb9, 0xd0, 0xf7, 0x63, 0x44, 0x88, 0x96, 0x63, 0xc9, 0xb7, 0x44, 0xd8, 0xe1, 0xd1, 0x0a, 0x0f, + 0xaa, 0xdb, 0x60, 0xa5, 0x0f, 0x8f, 0xa6, 0xc1, 0x6e, 0x30, 0xd8, 0x32, 0x8f, 0x4e, 0xa0, 0x1c, + 0x20, 0x93, 0x04, 0xc6, 0x89, 0xdb, 0x8f, 0xb1, 0x87, 0xb4, 0x59, 0x9a, 0x6a, 0x6d, 0x3e, 0x3f, + 0x2b, 0x66, 0xfe, 0x3c, 0x2b, 0xbe, 0xcb, 0xc5, 0x24, 0xfe, 0x23, 0x03, 0x47, 0x66, 0x00, 0x93, + 0xae, 0xb1, 0x8b, 0x3a, 0xd0, 0x3b, 0xaa, 0x21, 0xef, 0xf7, 0x67, 0x1b, 0x40, 0x68, 0x5d, 0x43, + 0x9e, 0x03, 0x18, 0xcb, 0x1e, 0x25, 0x51, 0xbf, 0x95, 0x40, 0x7e, 0x74, 0x04, 0xda, 0x27, 0xed, + 0xad, 0x92, 0x54, 0x96, 0xb7, 0x56, 0x0d, 0x91, 0x4f, 0x1b, 0x69, 0x88, 0x46, 0x1a, 0xd5, 0x08, + 0x87, 0x96, 0x4d, 0x37, 0xfc, 0xe5, 0xbc, 0x78, 0xbb, 0x83, 0x93, 0xee, 0xa0, 0x6d, 0x78, 0x51, + 0x20, 0x1a, 0x29, 0xfe, 0x6d, 0x10, 0xff, 0x91, 0x49, 0xe5, 0x23, 0x0c, 0xf0, 0xdd, 0x8b, 0xa7, + 0xeb, 0xf9, 0x1e, 0x2b, 0x85, 0xed, 0x40, 0x7e, 0x7e, 0xf1, 0x74, 0x5d, 0x72, 0x64, 0xb1, 0x2b, + 0x4d, 0x51, 0xd7, 0xc1, 0x92, 0xd0, 0x83, 0x66, 0xb8, 0x3e, 0x0a, 0xa3, 0x40, 0x9b, 0x63, 0x52, + 0xdc, 0xe4, 0x01, 0x9a, 0x56, 0xa3, 0xcb, 0x54, 0xf3, 0x21, 0x22, 0xc9, 0x34, 0xf1, 0xe6, 0xb9, + 0xe6, 0x22, 0x3c, 0xa1, 0xde, 0x57, 0x60, 0x69, 0x84, 0x23, 0x5e, 0x17, 0xf9, 0x83, 0x1e, 0x22, + 0x1a, 0x28, 0xcd, 0x94, 0xe5, 0xad, 0xf7, 0x5f, 0xe6, 0x8a, 0x03, 0x0e, 0x6a, 0x0a, 0x8c, 0x95, + 0xa3, 0xe7, 0x77, 0x94, 0xe1, 0xf8, 0x32, 0x51, 0xab, 0x80, 0xeb, 0xea, 0x52, 0x87, 0x6a, 0x32, + 0x93, 0x51, 0x37, 0xb8, 0x7d, 0x8d, 0x91, 0x7d, 0x8d, 0xd6, 0xc8, 0xbe, 0xd6, 0x1c, 0xe5, 0x79, + 0x72, 0x5e, 0x94, 0x9c, 0x79, 0x86, 0xa3, 0x11, 0xb5, 0x02, 0xe6, 0x51, 0xe8, 0x33, 0x0a, 0xa2, + 0xe5, 0x59, 0x71, 0xaf, 0xc6, 0x31, 0x87, 0x42, 0x9f, 0xad, 0xab, 0x15, 0x30, 0x4b, 0x12, 0x98, + 0x0c, 0x88, 0xb6, 0xc0, 0x2c, 0xff, 0xde, 0x2b, 0x58, 0xbe, 0xc9, 0x00, 0x8e, 0x00, 0xde, 0x51, + 0x1e, 0x7f, 0x5f, 0xcc, 0xfc, 0xf6, 0x6c, 0x63, 0x4e, 0x84, 0xeb, 0x6b, 0x7f, 0x4b, 0x60, 0x69, + 0x07, 0x1f, 0x22, 0x9f, 0xb9, 0x66, 0x34, 0x6b, 0x7b, 0x20, 0x4f, 0xfd, 0xe1, 0x8a, 0x89, 0x60, + 0x53, 0x27, 0xbf, 0x7c, 0xc6, 0x52, 0xa3, 0x6a, 0xe5, 0x4e, 0xcf, 0x8a, 0x92, 0x23, 0xb7, 0x53, + 0xd3, 0xfb, 0x8d, 0x04, 0x56, 0x62, 0x14, 0x40, 0x1c, 0xb2, 0x3e, 0xa5, 0x8d, 0x99, 0xfd, 0x3f, + 0x63, 0x9a, 0xaf, 0x69, 0x4c, 0x67, 0xf9, 0xdf, 0x9d, 0x9a, 0x57, 0x5e, 0xbc, 0x93, 0xa3, 0x87, + 0x5f, 0xfb, 0x69, 0x06, 0xe4, 0x2d, 0x98, 0x78, 0xdd, 0x37, 0x77, 0xd6, 0x7d, 0xb0, 0x10, 0xe0, + 0xd0, 0x6d, 0x63, 0x5f, 0x0c, 0x74, 0xf6, 0xba, 0x03, 0x2d, 0x07, 0x38, 0xb4, 0x30, 0xef, 0x8d, + 0x7a, 0x00, 0x16, 0x02, 0x5a, 0x38, 0x1a, 0xd1, 0xce, 0x5c, 0x97, 0x36, 0x2f, 0x78, 0x38, 0xef, + 0x07, 0x40, 0x0d, 0xe0, 0xa1, 0x8b, 0x0e, 0x13, 0x14, 0xfa, 0xc8, 0x77, 0xe3, 0x68, 0x10, 0xfa, + 0xec, 0x9a, 0x5b, 0x70, 0x94, 0x00, 0x1e, 0xda, 0x22, 0xe0, 0xd0, 0x75, 0x15, 0x82, 0xb7, 0xc7, + 0x33, 0xdd, 0x18, 0x26, 0x88, 0x5f, 0x6f, 0xd7, 0xa9, 0x65, 0x09, 0xa5, 0xe9, 0x1d, 0x98, 0x20, + 0xd1, 0xa8, 0x1f, 0x25, 0x70, 0x73, 0x62, 0x44, 0xd5, 0xbb, 0x20, 0x1f, 0xa3, 0x1e, 0xa2, 0xed, + 0x62, 0xc3, 0x28, 0xbd, 0xc6, 0x30, 0xca, 0x02, 0xc9, 0xc6, 0xb1, 0x0e, 0x66, 0xbf, 0x46, 0xb8, + 0xd3, 0x4d, 0xae, 0xdf, 0x1b, 0x41, 0xb0, 0xfe, 0xab, 0x04, 0xe4, 0xd4, 0x07, 0x46, 0xfd, 0x10, + 0x68, 0x95, 0xfd, 0x6a, 0xab, 0x7e, 0xbf, 0xe1, 0xb6, 0x1e, 0xec, 0xd9, 0xee, 0x7e, 0xa3, 0xb9, + 0x67, 0x57, 0xeb, 0x3b, 0x75, 0xbb, 0xa6, 0x64, 0x74, 0xf5, 0xf8, 0xa4, 0xb4, 0x98, 0x4a, 0x6f, + 0xe0, 0x9e, 0xfa, 0xe9, 0x04, 0x62, 0xa7, 0xfe, 0x85, 0x5d, 0x73, 0xf7, 0x9c, 0x7a, 0xd5, 0x56, + 0x24, 0x7d, 0xf5, 0xf8, 0xa4, 0x74, 0x2b, 0x85, 0xb8, 0x9a, 0x56, 0xda, 0xb9, 0x31, 0xa0, 0x55, + 0x69, 0x55, 0xef, 0x29, 0x59, 0x7d, 0xf9, 0xf8, 0xa4, 0xa4, 0xa4, 0x20, 0xcc, 0xef, 0x7a, 0xee, + 0xf1, 0x0f, 0x85, 0xcc, 0xfa, 0x79, 0x16, 0x2c, 0x8c, 0x5d, 0x0e, 0xea, 0x36, 0xd0, 0x47, 0x2c, + 0xcd, 0x56, 0xa5, 0xb5, 0xdf, 0x9c, 0x28, 0x39, 0xcd, 0xc6, 0x21, 0xb4, 0xe8, 0x6d, 0xb0, 0x32, + 0x81, 0x6a, 0xb6, 0x2a, 0x8d, 0x9a, 0xf5, 0x40, 0x91, 0x74, 0xed, 0xf8, 0xa4, 0xb4, 0x3c, 0x86, + 0x68, 0x26, 0x30, 0xf4, 0xad, 0xa3, 0xe9, 0x28, 0xa7, 0x65, 0xd7, 0x94, 0xec, 0x74, 0x54, 0x9c, + 0x20, 0x7f, 0x0a, 0xea, 0xc0, 0x6e, 0xb6, 0xea, 0x8d, 0xbb, 0xca, 0xcc, 0x14, 0x94, 0x30, 0x0d, + 0xfd, 0x9e, 0x4c, 0xa0, 0x76, 0xea, 0x8d, 0x7a, 0xf3, 0x9e, 0x5d, 0x53, 0x72, 0x63, 0xaa, 0x72, + 0xd8, 0x0e, 0x0e, 0x31, 0xe9, 0x22, 0x5f, 0xfd, 0xec, 0xaa, 0x1d, 0x02, 0x57, 0xad, 0x34, 0xaa, + 0xf6, 0xee, 0xae, 0x5d, 0x53, 0x6e, 0xe8, 0xfa, 0xf1, 0x49, 0x69, 0x65, 0x0c, 0x58, 0x85, 0xa1, + 0x87, 0x7a, 0x3d, 0xe4, 0x73, 0x85, 0xad, 0xfb, 0xcf, 0x2f, 0x0a, 0xd2, 0xe9, 0x45, 0x41, 0xfa, + 0xeb, 0xa2, 0x20, 0x3d, 0xb9, 0x2c, 0x64, 0x4e, 0x2f, 0x0b, 0x99, 0x3f, 0x2e, 0x0b, 0x99, 0x2f, + 0x3f, 0x4e, 0x5d, 0x60, 0xcc, 0xf4, 0x71, 0x80, 0xc3, 0x64, 0xec, 0x77, 0xda, 0xe1, 0xd8, 0x1b, + 0xbb, 0xd3, 0xda, 0xb3, 0xcc, 0xd7, 0x1f, 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, 0x67, 0xe6, 0x53, + 0x57, 0xdd, 0x09, 0x00, 0x00, +} + +func (m *BaseAuction) 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 *BaseAuction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BaseAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x68 + } + if len(m.EndTimes) > 0 { + for iNdEx := len(m.EndTimes) - 1; iNdEx >= 0; iNdEx-- { + n, err := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndTimes[iNdEx], dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTimes[iNdEx]):]) + if err != nil { + return 0, err + } + i -= n + i = encodeVarintAuction(dAtA, i, uint64(n)) + i-- + dAtA[i] = 0x62 + } + } + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintAuction(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x5a + if len(m.VestingSchedules) > 0 { + for iNdEx := len(m.VestingSchedules) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.VestingSchedules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + } + if len(m.VestingReserveAddress) > 0 { + i -= len(m.VestingReserveAddress) + copy(dAtA[i:], m.VestingReserveAddress) + i = encodeVarintAuction(dAtA, i, uint64(len(m.VestingReserveAddress))) + i-- + dAtA[i] = 0x4a + } + if len(m.PayingCoinDenom) > 0 { + i -= len(m.PayingCoinDenom) + copy(dAtA[i:], m.PayingCoinDenom) + i = encodeVarintAuction(dAtA, i, uint64(len(m.PayingCoinDenom))) + i-- + dAtA[i] = 0x42 + } + { + size, err := m.SellingCoin.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + { + size := m.StartPrice.Size() + i -= size + if _, err := m.StartPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + if len(m.PayingReserveAddress) > 0 { + i -= len(m.PayingReserveAddress) + copy(dAtA[i:], m.PayingReserveAddress) + i = encodeVarintAuction(dAtA, i, uint64(len(m.PayingReserveAddress))) + i-- + dAtA[i] = 0x2a + } + if len(m.SellingReserveAddress) > 0 { + i -= len(m.SellingReserveAddress) + copy(dAtA[i:], m.SellingReserveAddress) + i = encodeVarintAuction(dAtA, i, uint64(len(m.SellingReserveAddress))) + i-- + dAtA[i] = 0x22 + } + if len(m.Auctioneer) > 0 { + i -= len(m.Auctioneer) + copy(dAtA[i:], m.Auctioneer) + i = encodeVarintAuction(dAtA, i, uint64(len(m.Auctioneer))) + i-- + dAtA[i] = 0x1a + } + if m.Type != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x10 + } + if m.Id != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *FixedPriceAuction) 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 *FixedPriceAuction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FixedPriceAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.RemainingSellingCoin.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.BaseAuction != nil { + { + size, err := m.BaseAuction.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BatchAuction) 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 *BatchAuction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BatchAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.ExtendedRoundRate.Size() + i -= size + if _, err := m.ExtendedRoundRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if m.MaxExtendedRound != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.MaxExtendedRound)) + i-- + dAtA[i] = 0x20 + } + { + size := m.MatchedPrice.Size() + i -= size + if _, err := m.MatchedPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.MinBidPrice.Size() + i -= size + if _, err := m.MinBidPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.BaseAuction != nil { + { + size, err := m.BaseAuction.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *VestingSchedule) 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 *VestingSchedule) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VestingSchedule) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Weight.Size() + i -= size + if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.ReleaseTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ReleaseTime):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintAuction(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintAuction(dAtA []byte, offset int, v uint64) int { + offset -= sovAuction(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *BaseAuction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovAuction(uint64(m.Id)) + } + if m.Type != 0 { + n += 1 + sovAuction(uint64(m.Type)) + } + l = len(m.Auctioneer) + if l > 0 { + n += 1 + l + sovAuction(uint64(l)) + } + l = len(m.SellingReserveAddress) + if l > 0 { + n += 1 + l + sovAuction(uint64(l)) + } + l = len(m.PayingReserveAddress) + if l > 0 { + n += 1 + l + sovAuction(uint64(l)) + } + l = m.StartPrice.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.SellingCoin.Size() + n += 1 + l + sovAuction(uint64(l)) + l = len(m.PayingCoinDenom) + if l > 0 { + n += 1 + l + sovAuction(uint64(l)) + } + l = len(m.VestingReserveAddress) + if l > 0 { + n += 1 + l + sovAuction(uint64(l)) + } + if len(m.VestingSchedules) > 0 { + for _, e := range m.VestingSchedules { + l = e.Size() + n += 1 + l + sovAuction(uint64(l)) + } + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime) + n += 1 + l + sovAuction(uint64(l)) + if len(m.EndTimes) > 0 { + for _, e := range m.EndTimes { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(e) + n += 1 + l + sovAuction(uint64(l)) + } + } + if m.Status != 0 { + n += 1 + sovAuction(uint64(m.Status)) + } + return n +} + +func (m *FixedPriceAuction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BaseAuction != nil { + l = m.BaseAuction.Size() + n += 1 + l + sovAuction(uint64(l)) + } + l = m.RemainingSellingCoin.Size() + n += 1 + l + sovAuction(uint64(l)) + return n +} + +func (m *BatchAuction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BaseAuction != nil { + l = m.BaseAuction.Size() + n += 1 + l + sovAuction(uint64(l)) + } + l = m.MinBidPrice.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.MatchedPrice.Size() + n += 1 + l + sovAuction(uint64(l)) + if m.MaxExtendedRound != 0 { + n += 1 + sovAuction(uint64(m.MaxExtendedRound)) + } + l = m.ExtendedRoundRate.Size() + n += 1 + l + sovAuction(uint64(l)) + return n +} + +func (m *VestingSchedule) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ReleaseTime) + n += 1 + l + sovAuction(uint64(l)) + l = m.Weight.Size() + n += 1 + l + sovAuction(uint64(l)) + return n +} + +func sovAuction(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAuction(x uint64) (n int) { + return sovAuction(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *BaseAuction) 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 ErrIntOverflowAuction + } + 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: BaseAuction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BaseAuction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= AuctionType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auctioneer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Auctioneer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SellingReserveAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SellingReserveAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PayingReserveAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PayingReserveAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StartPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SellingCoin", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SellingCoin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PayingCoinDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PayingCoinDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VestingReserveAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VestingReserveAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VestingSchedules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VestingSchedules = append(m.VestingSchedules, VestingSchedule{}) + if err := m.VestingSchedules[len(m.VestingSchedules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + 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 ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + 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 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndTimes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EndTimes = append(m.EndTimes, time.Time{}) + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&(m.EndTimes[len(m.EndTimes)-1]), dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= AuctionStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FixedPriceAuction) 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 ErrIntOverflowAuction + } + 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: FixedPriceAuction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FixedPriceAuction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseAuction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BaseAuction == nil { + m.BaseAuction = &BaseAuction{} + } + if err := m.BaseAuction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RemainingSellingCoin", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RemainingSellingCoin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BatchAuction) 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 ErrIntOverflowAuction + } + 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: BatchAuction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BatchAuction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseAuction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BaseAuction == nil { + m.BaseAuction = &BaseAuction{} + } + if err := m.BaseAuction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinBidPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinBidPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MatchedPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MatchedPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxExtendedRound", wireType) + } + m.MaxExtendedRound = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxExtendedRound |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExtendedRoundRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ExtendedRoundRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VestingSchedule) 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 ErrIntOverflowAuction + } + 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: VestingSchedule: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VestingSchedule: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReleaseTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.ReleaseTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAuction(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, ErrIntOverflowAuction + } + 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, ErrIntOverflowAuction + } + 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, ErrIntOverflowAuction + } + 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, ErrInvalidLengthAuction + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAuction + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAuction + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAuction = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAuction = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAuction = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/fundraising/types/auction_test.go b/x/fundraising/types/auction_test.go index b778c751..4a9a0cb2 100644 --- a/x/fundraising/types/auction_test.go +++ b/x/fundraising/types/auction_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + "cosmossdk.io/math" "github.com/cometbft/cometbft/crypto" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -21,12 +22,12 @@ func TestUnpackAuction(t *testing.T) { sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), types.SellingReserveAddress(1).String(), types.PayingReserveAddress(1).String(), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), sdk.NewInt64Coin("denom3", 1_000_000_000_000), "denom4", types.VestingReserveAddress(1).String(), []types.VestingSchedule{ - {ReleaseTime: types.MustParseRFC3339("2023-01-01T00:00:00Z"), Weight: sdk.OneDec()}, + {ReleaseTime: types.MustParseRFC3339("2023-01-01T00:00:00Z"), Weight: math.LegacyOneDec()}, }, types.MustParseRFC3339("2022-01-01T00:00:00Z"), []time.Time{types.MustParseRFC3339("2022-02-01T00:00:00Z")}, @@ -35,10 +36,10 @@ func TestUnpackAuction(t *testing.T) { sdk.NewInt64Coin("denom3", 1_000_000_000_000), ) - any, err := types.PackAuction(auction) + a, err := types.PackAuction(auction) require.NoError(t, err) - marshaled, err := any.Marshal() + marshaled, err := a.Marshal() require.NoError(t, err) var any2 codectypes.Any @@ -67,19 +68,19 @@ func TestUnpackAuction(t *testing.T) { require.Equal(t, auction.EndTimes[0].UTC(), auction2.GetEndTimes()[0].UTC()) require.Equal(t, auction.Status, auction2.GetStatus()) - auction2.SetId(5) - auction2.SetType(types.AuctionTypeBatch) - auction2.SetAuctioneer(sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer2")))) - auction2.SetSellingReserveAddress(types.SellingReserveAddress(5)) - auction2.SetPayingReserveAddress(types.PayingReserveAddress(5)) - auction2.SetVestingReserveAddress(types.VestingReserveAddress(5)) - auction2.SetStartPrice(sdk.OneDec()) - auction2.SetSellingCoin(sdk.NewInt64Coin("denom5", 1_000_000_000_000)) - auction2.SetPayingCoinDenom("denom6") - auction2.SetStartTime(types.MustParseRFC3339("2022-10-01T00:00:00Z")) - auction2.SetVestingSchedules([]types.VestingSchedule{{ReleaseTime: types.MustParseRFC3339("2023-01-01T00:00:00Z"), Weight: sdk.OneDec()}}) - auction2.SetEndTimes([]time.Time{types.MustParseRFC3339("2022-11-01T00:00:00Z")}) - auction2.SetStatus(types.AuctionStatusStarted) + require.NoError(t, auction2.SetId(5)) + require.NoError(t, auction2.SetType(types.AuctionTypeBatch)) + require.NoError(t, auction2.SetAuctioneer(sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer2"))))) + require.NoError(t, auction2.SetSellingReserveAddress(types.SellingReserveAddress(5))) + require.NoError(t, auction2.SetPayingReserveAddress(types.PayingReserveAddress(5))) + require.NoError(t, auction2.SetVestingReserveAddress(types.VestingReserveAddress(5))) + require.NoError(t, auction2.SetStartPrice(math.LegacyOneDec())) + require.NoError(t, auction2.SetSellingCoin(sdk.NewInt64Coin("denom5", 1_000_000_000_000))) + require.NoError(t, auction2.SetPayingCoinDenom("denom6")) + require.NoError(t, auction2.SetStartTime(types.MustParseRFC3339("2022-10-01T00:00:00Z"))) + require.NoError(t, auction2.SetVestingSchedules([]types.VestingSchedule{{ReleaseTime: types.MustParseRFC3339("2023-01-01T00:00:00Z"), Weight: math.LegacyOneDec()}})) + require.NoError(t, auction2.SetEndTimes([]time.Time{types.MustParseRFC3339("2022-11-01T00:00:00Z")})) + require.NoError(t, auction2.SetStatus(types.AuctionStatusStarted)) require.True(t, auction2.GetId() == 5) require.True(t, auction2.GetType() == types.AuctionTypeBatch) @@ -87,7 +88,7 @@ func TestUnpackAuction(t *testing.T) { require.True(t, auction2.GetSellingReserveAddress().Equals(types.SellingReserveAddress(5))) require.True(t, auction2.GetPayingReserveAddress().Equals(types.PayingReserveAddress(5))) require.True(t, auction2.GetVestingReserveAddress().Equals(types.VestingReserveAddress(5))) - require.True(t, auction2.GetStartPrice().Equal(sdk.OneDec())) + require.True(t, auction2.GetStartPrice().Equal(math.LegacyOneDec())) } func TestUnpackAuctionJSON(t *testing.T) { @@ -98,7 +99,7 @@ func TestUnpackAuctionJSON(t *testing.T) { sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), types.SellingReserveAddress(1).String(), types.PayingReserveAddress(1).String(), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), sdk.NewInt64Coin("denom1", 1_000_000_000_000), "denom2", types.VestingReserveAddress(1).String(), @@ -110,14 +111,14 @@ func TestUnpackAuctionJSON(t *testing.T) { sdk.NewInt64Coin("denom2", 1_000_000_000_000), ) - any, err := types.PackAuction(auction) + a, err := types.PackAuction(auction) require.NoError(t, err) registry := codectypes.NewInterfaceRegistry() types.RegisterInterfaces(registry) cdc := codec.NewProtoCodec(registry) - bz := cdc.MustMarshalJSON(any) + bz := cdc.MustMarshalJSON(a) var any2 codectypes.Any err = cdc.UnmarshalJSON(bz, &any2) @@ -138,7 +139,7 @@ func TestUnpackAuctions(t *testing.T) { sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), types.SellingReserveAddress(1).String(), types.PayingReserveAddress(1).String(), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), sdk.NewInt64Coin("denom1", 1_000_000_000_000), "denom2", types.VestingReserveAddress(1).String(), @@ -156,7 +157,7 @@ func TestUnpackAuctions(t *testing.T) { sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), types.SellingReserveAddress(1).String(), types.PayingReserveAddress(1).String(), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), sdk.NewInt64Coin("denom3", 1_000_000_000_000), "denom4", types.VestingReserveAddress(1).String(), @@ -165,20 +166,20 @@ func TestUnpackAuctions(t *testing.T) { []time.Time{time.Now().AddDate(0, 1, -1)}, types.AuctionStatusStarted, ), - sdk.MustNewDecFromStr("0.1"), - sdk.ZeroDec(), + math.LegacyMustNewDecFromStr("0.1"), + math.LegacyZeroDec(), uint32(3), - sdk.MustNewDecFromStr("0.15"), + math.LegacyMustNewDecFromStr("0.15"), ), } - any, err := types.PackAuction(auction[0]) + a, err := types.PackAuction(auction[0]) require.NoError(t, err) - any2, err := types.PackAuction(auction[1]) + a2, err := types.PackAuction(auction[1]) require.NoError(t, err) - anyAuctions := []*codectypes.Any{any, any2} + anyAuctions := []*codectypes.Any{a, a2} auctions, err := types.UnpackAuctions(anyAuctions) require.NoError(t, err) @@ -204,7 +205,7 @@ func TestShouldAuctionStarted(t *testing.T) { Auctioneer: sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), SellingReserveAddress: types.SellingReserveAddress(1).String(), PayingReserveAddress: types.PayingReserveAddress(1).String(), - StartPrice: sdk.MustNewDecFromStr("0.5"), + StartPrice: math.LegacyMustNewDecFromStr("0.5"), SellingCoin: sdk.NewInt64Coin("denom3", 1_000_000_000_000), PayingCoinDenom: "denom4", VestingReserveAddress: types.VestingReserveAddress(1).String(), @@ -237,7 +238,7 @@ func TestShouldAuctionClosed(t *testing.T) { Auctioneer: sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), SellingReserveAddress: types.SellingReserveAddress(1).String(), PayingReserveAddress: types.PayingReserveAddress(1).String(), - StartPrice: sdk.MustNewDecFromStr("0.5"), + StartPrice: math.LegacyMustNewDecFromStr("0.5"), SellingCoin: sdk.NewInt64Coin("denom3", 1_000_000_000_000), PayingCoinDenom: "denom4", VestingReserveAddress: types.VestingReserveAddress(1).String(), diff --git a/x/fundraising/types/bid.go b/x/fundraising/types/bid.go index 007b584e..333e6159 100644 --- a/x/fundraising/types/bid.go +++ b/x/fundraising/types/bid.go @@ -6,7 +6,7 @@ import ( ) // NewBid returns a new Bid. -func NewBid(auctionId uint64, bidder sdk.AccAddress, bidId uint64, bidType BidType, price sdk.Dec, coin sdk.Coin, isMatched bool) Bid { +func NewBid(auctionId uint64, bidder sdk.AccAddress, bidId uint64, bidType BidType, price math.LegacyDec, coin sdk.Coin, isMatched bool) Bid { return Bid{ AuctionId: auctionId, Bidder: bidder.String(), @@ -34,7 +34,7 @@ func (b *Bid) SetMatched(status bool) { // Note that we take as little coins as possible to prevent from overflowing the remaining selling coin. func (b Bid) ConvertToSellingAmount(denom string) (amount math.Int) { if b.Coin.Denom == denom { - return sdk.NewDecFromInt(b.Coin.Amount).QuoTruncate(b.Price).TruncateInt() // BidAmount / BidPrice + return math.LegacyNewDecFromInt(b.Coin.Amount).QuoTruncate(b.Price).TruncateInt() // BidAmount / BidPrice } return b.Coin.Amount } @@ -45,5 +45,5 @@ func (b Bid) ConvertToPayingAmount(denom string) (amount math.Int) { if b.Coin.Denom == denom { return b.Coin.Amount } - return sdk.NewDecFromInt(b.Coin.Amount).Mul(b.Price).Ceil().TruncateInt() // BidAmount * BidPrice + return math.LegacyNewDecFromInt(b.Coin.Amount).Mul(b.Price).Ceil().TruncateInt() // BidAmount * BidPrice } diff --git a/x/fundraising/types/bid.pb.go b/x/fundraising/types/bid.pb.go new file mode 100644 index 00000000..8809fa35 --- /dev/null +++ b/x/fundraising/types/bid.pb.go @@ -0,0 +1,635 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fundraising/fundraising/v1/bid.proto + +package types + +import ( + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + 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" + 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 + +// BidType enumerates the valid types of a bid. +type BidType int32 + +const ( + // BID_TYPE_UNSPECIFIED defines the default bid type + BidTypeNil BidType = 0 + // BID_TYPE_FIXED_PRICE defines a bid type for a fixed price auction type + BidTypeFixedPrice BidType = 1 + // BID_TYPE_BATCH_WORTH defines a bid type for How-Much-Worth-to-Buy of a + // batch auction + BidTypeBatchWorth BidType = 2 + // BID_TYPE_BATCH_MANY defines a bid type for How-Many-Coins-to-Buy of a batch + // auction + BidTypeBatchMany BidType = 3 +) + +var BidType_name = map[int32]string{ + 0: "BID_TYPE_UNSPECIFIED", + 1: "BID_TYPE_FIXED_PRICE", + 2: "BID_TYPE_BATCH_WORTH", + 3: "BID_TYPE_BATCH_MANY", +} + +var BidType_value = map[string]int32{ + "BID_TYPE_UNSPECIFIED": 0, + "BID_TYPE_FIXED_PRICE": 1, + "BID_TYPE_BATCH_WORTH": 2, + "BID_TYPE_BATCH_MANY": 3, +} + +func (x BidType) String() string { + return proto.EnumName(BidType_name, int32(x)) +} + +func (BidType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_527f99309e242c82, []int{0} +} + +// AddressType enumerates the available types of a address. +type AddressType int32 + +const ( + // the 32 bytes length address type of ADR 028. + AddressType32Bytes AddressType = 0 + // the default 20 bytes length address type. + AddressType20Bytes AddressType = 1 +) + +var AddressType_name = map[int32]string{ + 0: "ADDRESS_TYPE_32_BYTES", + 1: "ADDRESS_TYPE_20_BYTES", +} + +var AddressType_value = map[string]int32{ + "ADDRESS_TYPE_32_BYTES": 0, + "ADDRESS_TYPE_20_BYTES": 1, +} + +func (x AddressType) String() string { + return proto.EnumName(AddressType_name, int32(x)) +} + +func (AddressType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_527f99309e242c82, []int{1} +} + +// Bid defines a standard bid for an auction. +type Bid struct { + // auction_id specifies the id of the auction + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + // bidder specifies the bech32-encoded address that bids for the auction + Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` + // id specifies an index of a bid for the bidder + Id uint64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` + // type specifies the bid type; type 1 is fixed price, 2 is how-much-worth, 3 + // is how-many-coins + Type BidType `protobuf:"varint,4,opt,name=type,proto3,enum=fundraising.fundraising.v1.BidType" json:"type,omitempty"` + // price specifies the bid price in which price the bidder places the bid + Price cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=price,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"price"` + // coin specifies the amount of coin that the bidder bids + // for a fixed price auction, the denom is of the paying coin. + // for a batch auction of how-much-worth, the denom is of the paying coin. + // for a batch auction of how-many-coins, the denom is of the selling coin. + Coin types.Coin `protobuf:"bytes,6,opt,name=coin,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"coin"` + // is_matched specifies the bid that is a winning bid and enables the bidder + // to purchase the selling coin + IsMatched bool `protobuf:"varint,7,opt,name=is_matched,json=isMatched,proto3" json:"is_matched,omitempty"` +} + +func (m *Bid) Reset() { *m = Bid{} } +func (m *Bid) String() string { return proto.CompactTextString(m) } +func (*Bid) ProtoMessage() {} +func (*Bid) Descriptor() ([]byte, []int) { + return fileDescriptor_527f99309e242c82, []int{0} +} +func (m *Bid) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Bid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Bid.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 *Bid) XXX_Merge(src proto.Message) { + xxx_messageInfo_Bid.Merge(m, src) +} +func (m *Bid) XXX_Size() int { + return m.Size() +} +func (m *Bid) XXX_DiscardUnknown() { + xxx_messageInfo_Bid.DiscardUnknown(m) +} + +var xxx_messageInfo_Bid proto.InternalMessageInfo + +func init() { + proto.RegisterEnum("fundraising.fundraising.v1.BidType", BidType_name, BidType_value) + proto.RegisterEnum("fundraising.fundraising.v1.AddressType", AddressType_name, AddressType_value) + proto.RegisterType((*Bid)(nil), "fundraising.fundraising.v1.Bid") +} + +func init() { + proto.RegisterFile("fundraising/fundraising/v1/bid.proto", fileDescriptor_527f99309e242c82) +} + +var fileDescriptor_527f99309e242c82 = []byte{ + // 622 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0xc1, 0x4b, 0xdc, 0x4e, + 0x14, 0xc7, 0x33, 0xeb, 0xaa, 0x3f, 0xc7, 0x1f, 0xb2, 0xa6, 0x2a, 0x31, 0xa5, 0xd9, 0xd0, 0x16, + 0xba, 0x2c, 0x98, 0xb8, 0x2b, 0xa5, 0xd0, 0xdb, 0x66, 0x13, 0xeb, 0x42, 0xd5, 0x25, 0xbb, 0xc5, + 0xda, 0x4b, 0xc8, 0x66, 0xa6, 0xbb, 0x83, 0x6e, 0x66, 0xc9, 0x44, 0x31, 0xff, 0x81, 0xec, 0xa9, + 0xe7, 0xc2, 0x42, 0xa1, 0x97, 0xd2, 0x93, 0x87, 0xfe, 0x11, 0xd2, 0x93, 0xf4, 0x54, 0x7a, 0xb0, + 0x45, 0x0f, 0xd2, 0xff, 0xa2, 0x64, 0x32, 0x87, 0x58, 0xe9, 0x25, 0x99, 0xf7, 0xde, 0xf7, 0x33, + 0x6f, 0xde, 0x77, 0x18, 0xf8, 0xf8, 0xed, 0x51, 0x88, 0x22, 0x9f, 0x30, 0x12, 0xf6, 0xcd, 0xfc, + 0xfa, 0xb8, 0x66, 0xf6, 0x08, 0x32, 0x46, 0x11, 0x8d, 0xa9, 0xac, 0xe6, 0x2a, 0x46, 0x7e, 0x7d, + 0x5c, 0x53, 0x17, 0xfd, 0x21, 0x09, 0xa9, 0xc9, 0xbf, 0x99, 0x5c, 0xd5, 0x02, 0xca, 0x86, 0x94, + 0x99, 0x3d, 0x9f, 0x61, 0xf3, 0xb8, 0xd6, 0xc3, 0xb1, 0x5f, 0x33, 0x03, 0x4a, 0x42, 0x51, 0x5f, + 0xcd, 0xea, 0x1e, 0x8f, 0xcc, 0x2c, 0x10, 0xa5, 0xa5, 0x3e, 0xed, 0xd3, 0x2c, 0x9f, 0xae, 0xb2, + 0xec, 0xc3, 0xdf, 0x05, 0x38, 0x65, 0x11, 0x24, 0x3f, 0x80, 0xd0, 0x3f, 0x0a, 0x62, 0x42, 0x43, + 0x8f, 0x20, 0x05, 0xe8, 0xa0, 0x52, 0x74, 0xe7, 0x44, 0xa6, 0x85, 0xe4, 0x15, 0x38, 0xd3, 0x23, + 0x08, 0xe1, 0x48, 0x29, 0xe8, 0xa0, 0x32, 0xe7, 0x8a, 0x48, 0x5e, 0x80, 0x05, 0x82, 0x94, 0x29, + 0x2e, 0x2f, 0x10, 0x24, 0x3f, 0x83, 0xc5, 0x38, 0x19, 0x61, 0xa5, 0xa8, 0x83, 0xca, 0x42, 0xfd, + 0x91, 0xf1, 0xef, 0xe9, 0x0c, 0x8b, 0xa0, 0x6e, 0x32, 0xc2, 0x2e, 0x07, 0xe4, 0x17, 0x70, 0x7a, + 0x14, 0x91, 0x00, 0x2b, 0xd3, 0xe9, 0xfe, 0x56, 0xed, 0xfc, 0xb2, 0x2c, 0xfd, 0xb8, 0x2c, 0xdf, + 0xcf, 0x46, 0x60, 0xe8, 0xc0, 0x20, 0xd4, 0x1c, 0xfa, 0xf1, 0xc0, 0x78, 0x89, 0xfb, 0x7e, 0x90, + 0xd8, 0x38, 0xf8, 0xf6, 0x65, 0x0d, 0x8a, 0x09, 0x6d, 0x1c, 0xb8, 0x19, 0x2f, 0xc7, 0xb0, 0x98, + 0xfa, 0xa1, 0xcc, 0xe8, 0xa0, 0x32, 0x5f, 0x5f, 0x35, 0x84, 0x22, 0x35, 0xcc, 0x10, 0x86, 0x19, + 0x4d, 0x4a, 0x42, 0xcb, 0x49, 0x5b, 0x7c, 0xfe, 0x59, 0x7e, 0xd2, 0x27, 0xf1, 0xe0, 0xa8, 0x67, + 0x04, 0x74, 0x28, 0x0c, 0x13, 0xbf, 0x35, 0x86, 0x0e, 0xcc, 0xf4, 0x70, 0x8c, 0x03, 0xef, 0x6f, + 0xce, 0xaa, 0xff, 0x1f, 0xf2, 0xe6, 0x5e, 0xda, 0x81, 0x7d, 0xba, 0x39, 0xab, 0x02, 0x97, 0x77, + 0x4b, 0xed, 0x23, 0xcc, 0x1b, 0xfa, 0x71, 0x30, 0xc0, 0x48, 0x99, 0xd5, 0x41, 0xe5, 0x3f, 0x77, + 0x8e, 0xb0, 0xed, 0x2c, 0xf1, 0xbc, 0x78, 0xfa, 0xa1, 0x2c, 0x55, 0xbf, 0x02, 0x38, 0x2b, 0xa6, + 0x96, 0x2b, 0x70, 0xc9, 0x6a, 0xd9, 0x5e, 0x77, 0xbf, 0xed, 0x78, 0xaf, 0x76, 0x3a, 0x6d, 0xa7, + 0xd9, 0xda, 0x6c, 0x39, 0x76, 0x49, 0x52, 0x17, 0xc6, 0x13, 0x1d, 0x0a, 0xd9, 0x0e, 0x39, 0x94, + 0xcd, 0x9c, 0x72, 0xb3, 0xf5, 0xda, 0xb1, 0xbd, 0xb6, 0xdb, 0x6a, 0x3a, 0x25, 0xa0, 0x2e, 0x8f, + 0x27, 0xfa, 0xa2, 0x50, 0x6e, 0x92, 0x13, 0x8c, 0xda, 0xdc, 0x81, 0x3c, 0x60, 0x35, 0xba, 0xcd, + 0x2d, 0x6f, 0x6f, 0xd7, 0xed, 0x6e, 0x95, 0x0a, 0xb7, 0x00, 0x2b, 0x3d, 0xda, 0x1e, 0x8d, 0xe2, + 0x81, 0xbc, 0x06, 0xef, 0xfd, 0x05, 0x6c, 0x37, 0x76, 0xf6, 0x4b, 0x53, 0xea, 0xd2, 0x78, 0xa2, + 0x97, 0xf2, 0xfa, 0x6d, 0x3f, 0x4c, 0xd4, 0xe2, 0xe9, 0x47, 0x4d, 0xaa, 0x26, 0x70, 0xbe, 0x81, + 0x50, 0x84, 0x19, 0xe3, 0xf3, 0xd4, 0xe0, 0x72, 0xc3, 0xb6, 0x5d, 0xa7, 0xd3, 0xc9, 0xf6, 0xd9, + 0xa8, 0x7b, 0xd6, 0x7e, 0xd7, 0xe9, 0x94, 0x24, 0x75, 0x65, 0x3c, 0xd1, 0xe5, 0x9c, 0x76, 0xa3, + 0x6e, 0x25, 0x31, 0x66, 0x77, 0x90, 0xfa, 0xba, 0x40, 0xc0, 0x1d, 0xa4, 0xbe, 0xce, 0x91, 0xac, + 0xb5, 0xb5, 0x7b, 0x7e, 0xa5, 0x81, 0x8b, 0x2b, 0x0d, 0xfc, 0xba, 0xd2, 0xc0, 0xbb, 0x6b, 0x4d, + 0xba, 0xb8, 0xd6, 0xa4, 0xef, 0xd7, 0x9a, 0xf4, 0xe6, 0x69, 0xee, 0x2e, 0x63, 0x1c, 0x22, 0x1c, + 0x0d, 0x49, 0x18, 0xdf, 0x7a, 0x7d, 0x27, 0xb7, 0x22, 0x7e, 0xbd, 0xbd, 0x19, 0xfe, 0x16, 0x36, + 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0xa2, 0x56, 0x83, 0x81, 0xb3, 0x03, 0x00, 0x00, +} + +func (m *Bid) 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 *Bid) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IsMatched { + i-- + if m.IsMatched { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + { + size, err := m.Coin.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBid(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size := m.Price.Size() + i -= size + if _, err := m.Price.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintBid(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if m.Type != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x20 + } + if m.Id != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x18 + } + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintBid(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x12 + } + if m.AuctionId != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintBid(dAtA []byte, offset int, v uint64) int { + offset -= sovBid(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Bid) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovBid(uint64(m.AuctionId)) + } + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovBid(uint64(l)) + } + if m.Id != 0 { + n += 1 + sovBid(uint64(m.Id)) + } + if m.Type != 0 { + n += 1 + sovBid(uint64(m.Type)) + } + l = m.Price.Size() + n += 1 + l + sovBid(uint64(l)) + l = m.Coin.Size() + n += 1 + l + sovBid(uint64(l)) + if m.IsMatched { + n += 2 + } + return n +} + +func sovBid(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBid(x uint64) (n int) { + return sovBid(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Bid) 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 ErrIntOverflowBid + } + 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: Bid: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Bid: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + 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 ErrInvalidLengthBid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= BidType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + 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 ErrInvalidLengthBid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Coin", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBid + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Coin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsMatched", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsMatched = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipBid(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBid + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBid(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, ErrIntOverflowBid + } + 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, ErrIntOverflowBid + } + 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, ErrIntOverflowBid + } + 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, ErrInvalidLengthBid + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBid + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthBid + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthBid = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBid = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBid = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/fundraising/types/bid_test.go b/x/fundraising/types/bid_test.go index 1b8b4620..09ee0121 100644 --- a/x/fundraising/types/bid_test.go +++ b/x/fundraising/types/bid_test.go @@ -19,39 +19,39 @@ func TestConvertToSellingAmount(t *testing.T) { expectedAmt math.Int }{ { - types.Bid{ - Price: sdk.MustNewDecFromStr("0.5"), - Coin: sdk.NewCoin("denom1", sdk.NewInt(100_000)), + bid: types.Bid{ + Price: math.LegacyMustNewDecFromStr("0.5"), + Coin: sdk.NewCoin("denom1", math.NewInt(100_000)), }, - sdk.NewInt(100_000), + expectedAmt: math.NewInt(100_000), }, { - types.Bid{ - Price: sdk.MustNewDecFromStr("0.5"), - Coin: sdk.NewCoin("denom2", sdk.NewInt(100_000)), + bid: types.Bid{ + Price: math.LegacyMustNewDecFromStr("0.5"), + Coin: sdk.NewCoin("denom2", math.NewInt(100_000)), }, - sdk.NewInt(200_000), + expectedAmt: math.NewInt(200_000), }, { - types.Bid{ - Price: sdk.MustNewDecFromStr("0.1"), - Coin: sdk.NewCoin("denom1", sdk.NewInt(100_000)), + bid: types.Bid{ + Price: math.LegacyMustNewDecFromStr("0.1"), + Coin: sdk.NewCoin("denom1", math.NewInt(100_000)), }, - sdk.NewInt(100_000), + expectedAmt: math.NewInt(100_000), }, { - types.Bid{ - Price: sdk.MustNewDecFromStr("0.1"), - Coin: sdk.NewCoin("denom2", sdk.NewInt(100_000)), + bid: types.Bid{ + Price: math.LegacyMustNewDecFromStr("0.1"), + Coin: sdk.NewCoin("denom2", math.NewInt(100_000)), }, - sdk.NewInt(1_000_000), + expectedAmt: math.NewInt(1_000_000), }, { - types.Bid{ - Price: sdk.MustNewDecFromStr("3"), - Coin: sdk.NewCoin("denom2", sdk.NewInt(4)), + bid: types.Bid{ + Price: math.LegacyMustNewDecFromStr("3"), + Coin: sdk.NewCoin("denom2", math.NewInt(4)), }, - sdk.NewInt(1), + expectedAmt: math.NewInt(1), }, } @@ -69,39 +69,39 @@ func TestConvertToPayingAmount(t *testing.T) { expectedAmt math.Int }{ { - types.Bid{ - Price: sdk.MustNewDecFromStr("0.5"), - Coin: sdk.NewCoin("denom1", sdk.NewInt(100_000)), + bid: types.Bid{ + Price: math.LegacyMustNewDecFromStr("0.5"), + Coin: sdk.NewCoin("denom1", math.NewInt(100_000)), }, - sdk.NewInt(50_000), + expectedAmt: math.NewInt(50_000), }, { - types.Bid{ - Price: sdk.MustNewDecFromStr("0.5"), - Coin: sdk.NewCoin("denom2", sdk.NewInt(100_000)), + bid: types.Bid{ + Price: math.LegacyMustNewDecFromStr("0.5"), + Coin: sdk.NewCoin("denom2", math.NewInt(100_000)), }, - sdk.NewInt(100_000), + expectedAmt: math.NewInt(100_000), }, { - types.Bid{ - Price: sdk.MustNewDecFromStr("0.1"), - Coin: sdk.NewCoin("denom1", sdk.NewInt(100_000)), + bid: types.Bid{ + Price: math.LegacyMustNewDecFromStr("0.1"), + Coin: sdk.NewCoin("denom1", math.NewInt(100_000)), }, - sdk.NewInt(10_000), + expectedAmt: math.NewInt(10_000), }, { - types.Bid{ - Price: sdk.MustNewDecFromStr("0.1"), - Coin: sdk.NewCoin("denom2", sdk.NewInt(100_000)), + bid: types.Bid{ + Price: math.LegacyMustNewDecFromStr("0.1"), + Coin: sdk.NewCoin("denom2", math.NewInt(100_000)), }, - sdk.NewInt(100_000), + expectedAmt: math.NewInt(100_000), }, { - types.Bid{ - Price: sdk.MustNewDecFromStr("0.33"), - Coin: sdk.NewCoin("denom1", sdk.NewInt(100_000)), + bid: types.Bid{ + Price: math.LegacyMustNewDecFromStr("0.33"), + Coin: sdk.NewCoin("denom1", math.NewInt(100_000)), }, - sdk.NewInt(33000), + expectedAmt: math.NewInt(33000), }, } @@ -119,8 +119,8 @@ func TestSetMatched(t *testing.T) { bidder, 1, types.BidTypeFixedPrice, - sdk.MustNewDecFromStr("0.5"), - sdk.NewCoin("denom1", sdk.NewInt(100_000)), + math.LegacyMustNewDecFromStr("0.5"), + sdk.NewCoin("denom1", math.NewInt(100_000)), false, ) require.False(t, bid.IsMatched) diff --git a/x/fundraising/types/codec.go b/x/fundraising/types/codec.go index 87840baa..0840dccc 100644 --- a/x/fundraising/types/codec.go +++ b/x/fundraising/types/codec.go @@ -1,27 +1,25 @@ package types import ( - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" + // this line is used by starport scaffolding # 1 ) -func RegisterCodec(cdc *codec.LegacyAmino) { -} +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + // this line is used by starport scaffolding # 3 -func RegisterInterfaces(registry codectypes.InterfaceRegistry) { - registry.RegisterImplementations( - (*sdk.Msg)(nil), + registry.RegisterImplementations((*sdk.Msg)(nil), &MsgCreateFixedPriceAuction{}, &MsgCreateBatchAuction{}, &MsgCancelAuction{}, &MsgPlaceBid{}, &MsgAddAllowedBidder{}, + &MsgUpdateParams{}, ) - registry.RegisterInterface( - "cosmos.fundraising.v1beta1.AuctionI", + "tendermint.fundraising.fundraising.v1.AuctionI", (*AuctionI)(nil), &FixedPriceAuction{}, &BatchAuction{}, @@ -29,8 +27,3 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } - -var ( - Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) -) diff --git a/x/fundraising/types/errors.go b/x/fundraising/types/errors.go index f9e01a51..697f73fa 100644 --- a/x/fundraising/types/errors.go +++ b/x/fundraising/types/errors.go @@ -3,21 +3,22 @@ package types // DONTCOVER import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + sdkerrors "cosmossdk.io/errors" ) // x/fundraising module sentinel errors var ( - ErrInvalidAuctionType = sdkerrors.Register(ModuleName, 2, "invalid auction type") - ErrInvalidStartPrice = sdkerrors.Register(ModuleName, 3, "invalid start price") - ErrInvalidVestingSchedules = sdkerrors.Register(ModuleName, 4, "invalid vesting schedules") - ErrInvalidAuctionStatus = sdkerrors.Register(ModuleName, 5, "invalid auction status") - ErrInvalidMaxBidAmount = sdkerrors.Register(ModuleName, 6, "invalid maximum bid amount") - ErrIncorrectAuctionType = sdkerrors.Register(ModuleName, 7, "incorrect auction type") - ErrIncorrectCoinDenom = sdkerrors.Register(ModuleName, 8, "incorrect coin denom") - ErrEmptyAllowedBidders = sdkerrors.Register(ModuleName, 9, "empty bidders") - ErrNotAllowedBidder = sdkerrors.Register(ModuleName, 10, "not allowed bidder") - ErrOverMaxBidAmountLimit = sdkerrors.Register(ModuleName, 11, "over maximum bid amount limit") - ErrInsufficientRemainingAmount = sdkerrors.Register(ModuleName, 12, "insufficient remaining amount") - ErrInsufficientMinBidPrice = sdkerrors.Register(ModuleName, 13, "insufficient bid price") + ErrInvalidSigner = sdkerrors.Register(ModuleName, 1101, "expected gov account as only signer for proposal message") + ErrInvalidAuctionType = sdkerrors.Register(ModuleName, 1102, "invalid auction type") + ErrInvalidStartPrice = sdkerrors.Register(ModuleName, 1103, "invalid start price") + ErrInvalidVestingSchedules = sdkerrors.Register(ModuleName, 1104, "invalid vesting schedules") + ErrInvalidAuctionStatus = sdkerrors.Register(ModuleName, 1105, "invalid auction status") + ErrInvalidMaxBidAmount = sdkerrors.Register(ModuleName, 1106, "invalid maximum bid amount") + ErrIncorrectAuctionType = sdkerrors.Register(ModuleName, 1107, "incorrect auction type") + ErrIncorrectCoinDenom = sdkerrors.Register(ModuleName, 1108, "incorrect coin denom") + ErrEmptyAllowedBidders = sdkerrors.Register(ModuleName, 1109, "empty bidders") + ErrNotAllowedBidder = sdkerrors.Register(ModuleName, 1110, "not allowed bidder") + ErrOverMaxBidAmountLimit = sdkerrors.Register(ModuleName, 1111, "over maximum bid amount limit") + ErrInsufficientRemainingAmount = sdkerrors.Register(ModuleName, 1112, "insufficient remaining amount") + ErrInsufficientMinBidPrice = sdkerrors.Register(ModuleName, 1113, "insufficient bid price") ) diff --git a/x/fundraising/types/events.go b/x/fundraising/types/events.go deleted file mode 100644 index e625d915..00000000 --- a/x/fundraising/types/events.go +++ /dev/null @@ -1,30 +0,0 @@ -package types - -// Event types for the farming module. -const ( - EventTypeCreateFixedPriceAuction = "create_fixed_price_auction" - EventTypeCreateBatchAuction = "create_batch_auction" - EventTypeCancelAuction = "cancel_auction" - EventTypePlaceBid = "place_bid" - - AttributeKeyAuctionId = "auction_id" //nolint:golint - AttributeKeyAuctioneerAddress = "auctioneer_address" - AttributeKeySellingReserveAddress = "selling_pool_address" - AttributeKeyPayingReserveAddress = "paying_pool_address" - AttributeKeyVestingReserveAddress = "vesting_pool_address" - AttributeKeyStartPrice = "start_price" - AttributeKeySellingCoin = "selling_coin" - AttributeKeyRemainingSellingCoin = "remaining_selling_coin" - AttributeKeyVestingSchedules = "vesting_schedules" - AttributeKeyPayingCoinDenom = "paying_coin_denom" - AttributeKeyAuctionStatus = "auction_status" - AttributeKeyStartTime = "start_time" - AttributeKeyEndTime = "end_time" - AttributeKeyBidderAddress = "bidder_address" - AttributeKeyBidPrice = "bid_price" - AttributeKeyBidCoin = "bid_coin" - AttributeKeyBidAmount = "bid_amount" - AttributeKeyMinBidPrice = "min_bid_price" - AttributeKeyMaxExtendedRound = "maximum_extended_round" - AttributeKeyExtendedRoundRate = "extended_round_rate" -) diff --git a/x/fundraising/types/expected_keepers.go b/x/fundraising/types/expected_keepers.go index 7ef6c9d3..ddc605a8 100644 --- a/x/fundraising/types/expected_keepers.go +++ b/x/fundraising/types/expected_keepers.go @@ -1,34 +1,39 @@ package types import ( + "context" "time" "cosmossdk.io/math" 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" ) -// AccountKeeper defines the expected account keeper. +// AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI GetModuleAddress(name string) sdk.AccAddress } -// BankKeeper defines the expected bank send keeper. +// BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - InputOutputCoins(ctx sdk.Context, inputs []banktypes.Input, outputs []banktypes.Output) error - // MintCoins and SendCoinsFromModuleToAccount are used only for simulation test codes - MintCoins(ctx sdk.Context, name string, amt sdk.Coins) error - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoins(ctx context.Context, from, to sdk.AccAddress, amt sdk.Coins) error + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + InputOutputCoins(ctx context.Context, input banktypes.Input, outputs []banktypes.Output) error + MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error } -// DistrKeeper is the keeper of the distribution store +// DistrKeeper defines the contract needed to be fulfilled for distribution keeper. type DistrKeeper interface { - FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error + FundCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error +} + +// ParamSubspace defines the expected Subspace interface for parameters. +type ParamSubspace interface { + Get(context.Context, []byte, interface{}) + Set(context.Context, []byte, interface{}) } // Event Hooks @@ -38,99 +43,104 @@ type DistrKeeper interface { // FundraisingHooks event hooks for fundraising auction and bid objects (noalias) type FundraisingHooks interface { BeforeFixedPriceAuctionCreated( - ctx sdk.Context, + ctx context.Context, auctioneer string, - startPrice sdk.Dec, + startPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []VestingSchedule, startTime time.Time, endTime time.Time, - ) + ) error AfterFixedPriceAuctionCreated( - ctx sdk.Context, + ctx context.Context, auctionId uint64, auctioneer string, - startPrice sdk.Dec, + startPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []VestingSchedule, startTime time.Time, endTime time.Time, - ) + ) error BeforeBatchAuctionCreated( - ctx sdk.Context, + ctx context.Context, auctioneer string, - startPrice sdk.Dec, - minBidPrice sdk.Dec, + startPrice math.LegacyDec, + minBidPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []VestingSchedule, maxExtendedRound uint32, - extendedRoundRate sdk.Dec, + extendedRoundRate math.LegacyDec, startTime time.Time, endTime time.Time, - ) + ) error AfterBatchAuctionCreated( - ctx sdk.Context, + ctx context.Context, auctionId uint64, auctioneer string, - startPrice sdk.Dec, - minBidPrice sdk.Dec, + startPrice math.LegacyDec, + minBidPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []VestingSchedule, maxExtendedRound uint32, - extendedRoundRate sdk.Dec, + extendedRoundRate math.LegacyDec, startTime time.Time, endTime time.Time, - ) + ) error BeforeAuctionCanceled( - ctx sdk.Context, + ctx context.Context, auctionId uint64, auctioneer string, - ) + ) error BeforeBidPlaced( - ctx sdk.Context, + ctx context.Context, auctionId uint64, bidId uint64, bidder string, bidType BidType, - price sdk.Dec, + price math.LegacyDec, coin sdk.Coin, - ) + ) error BeforeBidModified( - ctx sdk.Context, + ctx context.Context, auctionId uint64, bidId uint64, bidder string, bidType BidType, - price sdk.Dec, + price math.LegacyDec, coin sdk.Coin, - ) + ) error BeforeAllowedBiddersAdded( - ctx sdk.Context, + ctx context.Context, allowedBidders []AllowedBidder, - ) + ) error BeforeAllowedBidderUpdated( - ctx sdk.Context, + ctx context.Context, auctionId uint64, bidder sdk.AccAddress, maxBidAmount math.Int, - ) + ) error BeforeSellingCoinsAllocated( - ctx sdk.Context, + ctx context.Context, auctionId uint64, allocationMap map[string]math.Int, refundMap map[string]math.Int, - ) + ) error } + +type FundraisingHooksWrapper struct{ FundraisingHooks } + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (FundraisingHooksWrapper) IsOnePerModuleType() {} diff --git a/x/fundraising/types/fundraising.pb.go b/x/fundraising/types/fundraising.pb.go deleted file mode 100644 index 5d1a9a4b..00000000 --- a/x/fundraising/types/fundraising.pb.go +++ /dev/null @@ -1,2813 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: fundraising/fundraising.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "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. -// 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 - -// AuctionType enumerates the valid types of an auction. -type AuctionType int32 - -const ( - // AUCTION_TYPE_UNSPECIFIED defines the default auction type - AuctionTypeNil AuctionType = 0 - // AUCTION_TYPE_FIXED_PRICE defines the fixed price auction type - AuctionTypeFixedPrice AuctionType = 1 - // AUCTION_TYPE_BATCH defines the batch auction type - AuctionTypeBatch AuctionType = 2 -) - -var AuctionType_name = map[int32]string{ - 0: "AUCTION_TYPE_UNSPECIFIED", - 1: "AUCTION_TYPE_FIXED_PRICE", - 2: "AUCTION_TYPE_BATCH", -} - -var AuctionType_value = map[string]int32{ - "AUCTION_TYPE_UNSPECIFIED": 0, - "AUCTION_TYPE_FIXED_PRICE": 1, - "AUCTION_TYPE_BATCH": 2, -} - -func (x AuctionType) String() string { - return proto.EnumName(AuctionType_name, int32(x)) -} - -func (AuctionType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_a97a388085f27061, []int{0} -} - -// AuctionStatus enumerates the valid status of an auction. -type AuctionStatus int32 - -const ( - // AUCTION_STATUS_UNSPECIFIED defines the default auction status - AuctionStatusNil AuctionStatus = 0 - // AUCTION_STATUS_STANDBY defines the standby auction status - AuctionStatusStandBy AuctionStatus = 1 - // AUCTION_STATUS_STARTED defines the started auction status - AuctionStatusStarted AuctionStatus = 2 - // AUCTION_STATUS_VESTING defines the vesting auction status - AuctionStatusVesting AuctionStatus = 3 - // AUCTION_STATUS_FINISHED defines the finished auction status - AuctionStatusFinished AuctionStatus = 4 - // AUCTION_STATUS_CANCELLED defines the cancelled auction status - AuctionStatusCancelled AuctionStatus = 5 -) - -var AuctionStatus_name = map[int32]string{ - 0: "AUCTION_STATUS_UNSPECIFIED", - 1: "AUCTION_STATUS_STANDBY", - 2: "AUCTION_STATUS_STARTED", - 3: "AUCTION_STATUS_VESTING", - 4: "AUCTION_STATUS_FINISHED", - 5: "AUCTION_STATUS_CANCELLED", -} - -var AuctionStatus_value = map[string]int32{ - "AUCTION_STATUS_UNSPECIFIED": 0, - "AUCTION_STATUS_STANDBY": 1, - "AUCTION_STATUS_STARTED": 2, - "AUCTION_STATUS_VESTING": 3, - "AUCTION_STATUS_FINISHED": 4, - "AUCTION_STATUS_CANCELLED": 5, -} - -func (x AuctionStatus) String() string { - return proto.EnumName(AuctionStatus_name, int32(x)) -} - -func (AuctionStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_a97a388085f27061, []int{1} -} - -// BidType enumerates the valid types of a bid. -type BidType int32 - -const ( - // BID_TYPE_UNSPECIFIED defines the default bid type - BidTypeNil BidType = 0 - // BID_TYPE_FIXED_PRICE defines a bid type for a fixed price auction type - BidTypeFixedPrice BidType = 1 - // BID_TYPE_BATCH_WORTH defines a bid type for How-Much-Worth-to-Buy of a - // batch auction - BidTypeBatchWorth BidType = 2 - // BID_TYPE_BATCH_MANY defines a bid type for How-Many-Coins-to-Buy of a batch - // auction - BidTypeBatchMany BidType = 3 -) - -var BidType_name = map[int32]string{ - 0: "BID_TYPE_UNSPECIFIED", - 1: "BID_TYPE_FIXED_PRICE", - 2: "BID_TYPE_BATCH_WORTH", - 3: "BID_TYPE_BATCH_MANY", -} - -var BidType_value = map[string]int32{ - "BID_TYPE_UNSPECIFIED": 0, - "BID_TYPE_FIXED_PRICE": 1, - "BID_TYPE_BATCH_WORTH": 2, - "BID_TYPE_BATCH_MANY": 3, -} - -func (x BidType) String() string { - return proto.EnumName(BidType_name, int32(x)) -} - -func (BidType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_a97a388085f27061, []int{2} -} - -// AddressType enumerates the available types of a address. -type AddressType int32 - -const ( - // the 32 bytes length address type of ADR 028. - AddressType32Bytes AddressType = 0 - // the default 20 bytes length address type. - AddressType20Bytes AddressType = 1 -) - -var AddressType_name = map[int32]string{ - 0: "ADDRESS_TYPE_32_BYTES", - 1: "ADDRESS_TYPE_20_BYTES", -} - -var AddressType_value = map[string]int32{ - "ADDRESS_TYPE_32_BYTES": 0, - "ADDRESS_TYPE_20_BYTES": 1, -} - -func (x AddressType) String() string { - return proto.EnumName(AddressType_name, int32(x)) -} - -func (AddressType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_a97a388085f27061, []int{3} -} - -// BaseAuction defines a base auction type. It contains all the necessary fields -// for basic auction functionality. Any custom auction type should extend this -// type for additional functionality (e.g. batch auction, fixed price -// auction). -type BaseAuction struct { - // id specifies index of the auction - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // type specifies the auction type - // type 1 is fixed price and 2 is batch auction - Type AuctionType `protobuf:"varint,2,opt,name=type,proto3,enum=fundraising.AuctionType" json:"type,omitempty"` - // auctioneer specifies the bech32-encoded address that creates the auction - Auctioneer string `protobuf:"bytes,3,opt,name=auctioneer,proto3" json:"auctioneer,omitempty"` - // selling_reserve_address specifies the bech32-encoded address that has all - // the selling coin - SellingReserveAddress string `protobuf:"bytes,4,opt,name=selling_reserve_address,json=sellingReserveAddress,proto3" json:"selling_reserve_address,omitempty"` - // paying_reserve_address specifies the bech32-encoded address that has all - // the paying coin - PayingReserveAddress string `protobuf:"bytes,5,opt,name=paying_reserve_address,json=payingReserveAddress,proto3" json:"paying_reserve_address,omitempty"` - // start_price specifies the starting price of the auction - // it is determined by the proportion of the price of paying coin denom - StartPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=start_price,json=startPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"start_price"` - // selling_coin specifies the selling coin for the auction - SellingCoin types.Coin `protobuf:"bytes,7,opt,name=selling_coin,json=sellingCoin,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"selling_coin"` - // paying_coin_denom specifies the paying coin denom that bidders use to bid - // for - PayingCoinDenom string `protobuf:"bytes,8,opt,name=paying_coin_denom,json=payingCoinDenom,proto3" json:"paying_coin_denom,omitempty"` - // vesting_reserve_address specifies the bech32-encoded vesting address that - // holds vesting amounts of coin - VestingReserveAddress string `protobuf:"bytes,9,opt,name=vesting_reserve_address,json=vestingReserveAddress,proto3" json:"vesting_reserve_address,omitempty"` - // vesting_schedules specifies the vesting schedules for the auction - VestingSchedules []VestingSchedule `protobuf:"bytes,10,rep,name=vesting_schedules,json=vestingSchedules,proto3" json:"vesting_schedules"` - // start_time specifies the start time of the plan - StartTime time.Time `protobuf:"bytes,11,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"` - // end_times specifies the end time of the plan - EndTimes []time.Time `protobuf:"bytes,12,rep,name=end_times,json=endTimes,proto3,stdtime" json:"end_times"` - // status specifies the auction status - Status AuctionStatus `protobuf:"varint,13,opt,name=status,proto3,enum=fundraising.AuctionStatus" json:"status,omitempty"` -} - -func (m *BaseAuction) Reset() { *m = BaseAuction{} } -func (m *BaseAuction) String() string { return proto.CompactTextString(m) } -func (*BaseAuction) ProtoMessage() {} -func (*BaseAuction) Descriptor() ([]byte, []int) { - return fileDescriptor_a97a388085f27061, []int{0} -} -func (m *BaseAuction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BaseAuction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BaseAuction.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 *BaseAuction) XXX_Merge(src proto.Message) { - xxx_messageInfo_BaseAuction.Merge(m, src) -} -func (m *BaseAuction) XXX_Size() int { - return m.Size() -} -func (m *BaseAuction) XXX_DiscardUnknown() { - xxx_messageInfo_BaseAuction.DiscardUnknown(m) -} - -var xxx_messageInfo_BaseAuction proto.InternalMessageInfo - -// FixedPriceAuction defines the fixed price auction type. It is the most -// simpliest way to raise funds. An auctioneer sets the starting price for each -// selling amounts of coin and bidders bid to purchase based on the fixed price. -type FixedPriceAuction struct { - *BaseAuction `protobuf:"bytes,1,opt,name=base_auction,json=baseAuction,proto3,embedded=base_auction" json:"base_auction,omitempty"` - // remaining_coin specifies the remaining amount of selling coin to sell - RemainingSellingCoin types.Coin `protobuf:"bytes,2,opt,name=remaining_selling_coin,json=remainingSellingCoin,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"remaining_selling_coin"` -} - -func (m *FixedPriceAuction) Reset() { *m = FixedPriceAuction{} } -func (m *FixedPriceAuction) String() string { return proto.CompactTextString(m) } -func (*FixedPriceAuction) ProtoMessage() {} -func (*FixedPriceAuction) Descriptor() ([]byte, []int) { - return fileDescriptor_a97a388085f27061, []int{1} -} -func (m *FixedPriceAuction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FixedPriceAuction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FixedPriceAuction.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 *FixedPriceAuction) XXX_Merge(src proto.Message) { - xxx_messageInfo_FixedPriceAuction.Merge(m, src) -} -func (m *FixedPriceAuction) XXX_Size() int { - return m.Size() -} -func (m *FixedPriceAuction) XXX_DiscardUnknown() { - xxx_messageInfo_FixedPriceAuction.DiscardUnknown(m) -} - -var xxx_messageInfo_FixedPriceAuction proto.InternalMessageInfo - -// BatchAuction defines a batch auction type. It allows bidders to participate -// in the auction by placing their limit orders with a bid price they are -// willing to bid within the auction period. They can place multiple bids with -// different bid prices and if they want to modify their existing bid, they only -// have an option to modify with a higher bid price. Under the hood, an order -// book is created to record the bids to calculate the matched bidders. -type BatchAuction struct { - *BaseAuction `protobuf:"bytes,1,opt,name=base_auction,json=baseAuction,proto3,embedded=base_auction" json:"base_auction,omitempty"` - // min_bid_price specifies the minibum bid price - MinBidPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=min_bid_price,json=minBidPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_bid_price"` - // matched_price specifies the matched price of the auction - MatchedPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=matched_price,json=matchedPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"matched_price"` - // max_extended_round specifies a maximum number of extended rounds - MaxExtendedRound uint32 `protobuf:"varint,4,opt,name=max_extended_round,json=maxExtendedRound,proto3" json:"max_extended_round,omitempty"` - // extended_round_rate specifies the rate that decides if the auction needs - // another round - ExtendedRoundRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=extended_round_rate,json=extendedRoundRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"extended_round_rate"` -} - -func (m *BatchAuction) Reset() { *m = BatchAuction{} } -func (m *BatchAuction) String() string { return proto.CompactTextString(m) } -func (*BatchAuction) ProtoMessage() {} -func (*BatchAuction) Descriptor() ([]byte, []int) { - return fileDescriptor_a97a388085f27061, []int{2} -} -func (m *BatchAuction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BatchAuction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BatchAuction.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 *BatchAuction) XXX_Merge(src proto.Message) { - xxx_messageInfo_BatchAuction.Merge(m, src) -} -func (m *BatchAuction) XXX_Size() int { - return m.Size() -} -func (m *BatchAuction) XXX_DiscardUnknown() { - xxx_messageInfo_BatchAuction.DiscardUnknown(m) -} - -var xxx_messageInfo_BatchAuction proto.InternalMessageInfo - -// VestingSchedule defines the vesting schedule for the owner of an auction. -type VestingSchedule struct { - // release_time specifies the time for distribution of the vesting coin - ReleaseTime time.Time `protobuf:"bytes,1,opt,name=release_time,json=releaseTime,proto3,stdtime" json:"release_time"` - // weight specifies the vesting weight for the schedule - 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"` -} - -func (m *VestingSchedule) Reset() { *m = VestingSchedule{} } -func (m *VestingSchedule) String() string { return proto.CompactTextString(m) } -func (*VestingSchedule) ProtoMessage() {} -func (*VestingSchedule) Descriptor() ([]byte, []int) { - return fileDescriptor_a97a388085f27061, []int{3} -} -func (m *VestingSchedule) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VestingSchedule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VestingSchedule.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 *VestingSchedule) XXX_Merge(src proto.Message) { - xxx_messageInfo_VestingSchedule.Merge(m, src) -} -func (m *VestingSchedule) XXX_Size() int { - return m.Size() -} -func (m *VestingSchedule) XXX_DiscardUnknown() { - xxx_messageInfo_VestingSchedule.DiscardUnknown(m) -} - -var xxx_messageInfo_VestingSchedule proto.InternalMessageInfo - -func (m *VestingSchedule) GetReleaseTime() time.Time { - if m != nil { - return m.ReleaseTime - } - return time.Time{} -} - -// VestingQueue defines the vesting queue. -type VestingQueue struct { - // auction_id specifies the id of the auction - AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` - // auctioneer specifies the bech32-encoded address that creates the auction - Auctioneer string `protobuf:"bytes,2,opt,name=auctioneer,proto3" json:"auctioneer,omitempty"` - // paying_coin specifies the paying amount of coin - PayingCoin types.Coin `protobuf:"bytes,3,opt,name=paying_coin,json=payingCoin,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"paying_coin"` - // release_time specifies the timestamp of the vesting schedule - ReleaseTime time.Time `protobuf:"bytes,4,opt,name=release_time,json=releaseTime,proto3,stdtime" json:"release_time"` - // released specifies the status of distribution - Released bool `protobuf:"varint,5,opt,name=released,proto3" json:"released,omitempty"` -} - -func (m *VestingQueue) Reset() { *m = VestingQueue{} } -func (m *VestingQueue) String() string { return proto.CompactTextString(m) } -func (*VestingQueue) ProtoMessage() {} -func (*VestingQueue) Descriptor() ([]byte, []int) { - return fileDescriptor_a97a388085f27061, []int{4} -} -func (m *VestingQueue) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VestingQueue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VestingQueue.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 *VestingQueue) XXX_Merge(src proto.Message) { - xxx_messageInfo_VestingQueue.Merge(m, src) -} -func (m *VestingQueue) XXX_Size() int { - return m.Size() -} -func (m *VestingQueue) XXX_DiscardUnknown() { - xxx_messageInfo_VestingQueue.DiscardUnknown(m) -} - -var xxx_messageInfo_VestingQueue proto.InternalMessageInfo - -func (m *VestingQueue) GetAuctionId() uint64 { - if m != nil { - return m.AuctionId - } - return 0 -} - -func (m *VestingQueue) GetAuctioneer() string { - if m != nil { - return m.Auctioneer - } - return "" -} - -func (m *VestingQueue) GetPayingCoin() types.Coin { - if m != nil { - return m.PayingCoin - } - return types.Coin{} -} - -func (m *VestingQueue) GetReleaseTime() time.Time { - if m != nil { - return m.ReleaseTime - } - return time.Time{} -} - -func (m *VestingQueue) GetReleased() bool { - if m != nil { - return m.Released - } - return false -} - -// AllowedBidder defines an allowed bidder for the auction. -type AllowedBidder struct { - // bidder specifies the bech32-encoded address that bids for the auction - Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` - // max_bid_amount specifies the maximum bid amount that the bidder can bid - MaxBidAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=max_bid_amount,json=maxBidAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_bid_amount"` -} - -func (m *AllowedBidder) Reset() { *m = AllowedBidder{} } -func (m *AllowedBidder) String() string { return proto.CompactTextString(m) } -func (*AllowedBidder) ProtoMessage() {} -func (*AllowedBidder) Descriptor() ([]byte, []int) { - return fileDescriptor_a97a388085f27061, []int{5} -} -func (m *AllowedBidder) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AllowedBidder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AllowedBidder.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 *AllowedBidder) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllowedBidder.Merge(m, src) -} -func (m *AllowedBidder) XXX_Size() int { - return m.Size() -} -func (m *AllowedBidder) XXX_DiscardUnknown() { - xxx_messageInfo_AllowedBidder.DiscardUnknown(m) -} - -var xxx_messageInfo_AllowedBidder proto.InternalMessageInfo - -// Bid defines a standard bid for an auction. -type Bid struct { - // auction_id specifies the id of the auction - AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` - // bidder specifies the bech32-encoded address that bids for the auction - Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` - // id specifies an index of a bid for the bidder - Id uint64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` - // type specifies the bid type; type 1 is fixed price, 2 is how-much-worth, 3 - // is how-many-coins - Type BidType `protobuf:"varint,4,opt,name=type,proto3,enum=fundraising.BidType" json:"type,omitempty"` - // price specifies the bid price in which price the bidder places the bid - Price github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=price,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"price"` - // coin specifies the amount of coin that the bidder bids - // for a fixed price auction, the denom is of the paying coin. - // for a batch auction of how-much-worth, the denom is of the paying coin. - // for a batch auction of how-many-coins, the denom is of the selling coin. - Coin types.Coin `protobuf:"bytes,6,opt,name=coin,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"coin"` - // is_matched specifies the bid that is a winning bid and enables the bidder - // to purchase the selling coin - IsMatched bool `protobuf:"varint,7,opt,name=is_matched,json=isMatched,proto3" json:"is_matched,omitempty"` -} - -func (m *Bid) Reset() { *m = Bid{} } -func (m *Bid) String() string { return proto.CompactTextString(m) } -func (*Bid) ProtoMessage() {} -func (*Bid) Descriptor() ([]byte, []int) { - return fileDescriptor_a97a388085f27061, []int{6} -} -func (m *Bid) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Bid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Bid.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 *Bid) XXX_Merge(src proto.Message) { - xxx_messageInfo_Bid.Merge(m, src) -} -func (m *Bid) XXX_Size() int { - return m.Size() -} -func (m *Bid) XXX_DiscardUnknown() { - xxx_messageInfo_Bid.DiscardUnknown(m) -} - -var xxx_messageInfo_Bid proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("fundraising.AuctionType", AuctionType_name, AuctionType_value) - proto.RegisterEnum("fundraising.AuctionStatus", AuctionStatus_name, AuctionStatus_value) - proto.RegisterEnum("fundraising.BidType", BidType_name, BidType_value) - proto.RegisterEnum("fundraising.AddressType", AddressType_name, AddressType_value) - proto.RegisterType((*BaseAuction)(nil), "fundraising.BaseAuction") - proto.RegisterType((*FixedPriceAuction)(nil), "fundraising.FixedPriceAuction") - proto.RegisterType((*BatchAuction)(nil), "fundraising.BatchAuction") - proto.RegisterType((*VestingSchedule)(nil), "fundraising.VestingSchedule") - proto.RegisterType((*VestingQueue)(nil), "fundraising.VestingQueue") - proto.RegisterType((*AllowedBidder)(nil), "fundraising.AllowedBidder") - proto.RegisterType((*Bid)(nil), "fundraising.Bid") -} - -func init() { proto.RegisterFile("fundraising/fundraising.proto", fileDescriptor_a97a388085f27061) } - -var fileDescriptor_a97a388085f27061 = []byte{ - // 1338 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4f, 0x6f, 0xdb, 0xc6, - 0x12, 0x17, 0x25, 0x45, 0x91, 0x96, 0xb2, 0x43, 0x6f, 0x64, 0x3f, 0x86, 0x78, 0x91, 0x04, 0x1f, - 0xde, 0x13, 0x82, 0x44, 0x4a, 0x94, 0xf4, 0x0f, 0x72, 0x13, 0x25, 0x39, 0x11, 0x90, 0xc8, 0x2e, - 0xc9, 0x24, 0x75, 0x0f, 0x21, 0x28, 0xed, 0x46, 0x5e, 0x44, 0x24, 0x0d, 0x92, 0x72, 0xac, 0x5b, - 0x81, 0x5e, 0x02, 0x1d, 0x8a, 0x7c, 0x80, 0x0a, 0x2d, 0xda, 0x5b, 0xd1, 0x63, 0xbf, 0x40, 0x6f, - 0x41, 0x4e, 0x39, 0x16, 0x3d, 0xc4, 0x45, 0xf2, 0x45, 0x8a, 0xfd, 0x23, 0x9b, 0x92, 0x05, 0x34, - 0x31, 0x7c, 0x12, 0x77, 0x66, 0x7e, 0xb3, 0x3b, 0x33, 0xbf, 0x99, 0x5d, 0x81, 0xab, 0xcf, 0x46, - 0x1e, 0x0a, 0x1c, 0x12, 0x12, 0x6f, 0x50, 0x8b, 0x7d, 0x57, 0xf7, 0x03, 0x3f, 0xf2, 0xa1, 0x1c, - 0x13, 0x69, 0xc5, 0xbe, 0x1f, 0xba, 0x7e, 0x58, 0xeb, 0x39, 0x21, 0xae, 0x1d, 0xdc, 0xea, 0xe1, - 0xc8, 0xb9, 0x55, 0xeb, 0xfb, 0xc4, 0xe3, 0xc6, 0x5a, 0x61, 0xe0, 0x0f, 0x7c, 0xf6, 0x59, 0xa3, - 0x5f, 0x42, 0x7a, 0x85, 0xa3, 0x6c, 0xae, 0xe0, 0x0b, 0xa1, 0x2a, 0x0d, 0x7c, 0x7f, 0x30, 0xc4, - 0x35, 0xb6, 0xea, 0x8d, 0x9e, 0xd5, 0x22, 0xe2, 0xe2, 0x30, 0x72, 0xdc, 0x7d, 0x6e, 0xb0, 0xf9, - 0x43, 0x06, 0xc8, 0xba, 0x13, 0xe2, 0xc6, 0xa8, 0x1f, 0x11, 0xdf, 0x83, 0xab, 0x20, 0x49, 0x90, - 0x2a, 0x95, 0xa5, 0x4a, 0xda, 0x48, 0x12, 0x04, 0xaf, 0x83, 0x74, 0x34, 0xde, 0xc7, 0x6a, 0xb2, - 0x2c, 0x55, 0x56, 0xeb, 0x6a, 0x35, 0x1e, 0x80, 0xc0, 0x58, 0xe3, 0x7d, 0x6c, 0x30, 0x2b, 0x58, - 0x04, 0xc0, 0xe1, 0x42, 0x8c, 0x03, 0x35, 0x55, 0x96, 0x2a, 0x39, 0x23, 0x26, 0x81, 0x9f, 0x83, - 0xff, 0x84, 0x78, 0x38, 0x24, 0xde, 0xc0, 0x0e, 0x70, 0x88, 0x83, 0x03, 0x6c, 0x3b, 0x08, 0x05, - 0x38, 0x0c, 0xd5, 0x34, 0x33, 0x5e, 0x17, 0x6a, 0x83, 0x6b, 0x1b, 0x5c, 0x09, 0xef, 0x80, 0x8d, - 0x7d, 0x67, 0xbc, 0x0c, 0x76, 0x81, 0xc1, 0x0a, 0x5c, 0xbb, 0x80, 0xda, 0x06, 0x72, 0x18, 0x39, - 0x41, 0x64, 0xef, 0x07, 0xa4, 0x8f, 0xd5, 0x0c, 0x35, 0xd5, 0xab, 0xaf, 0xdf, 0x95, 0x12, 0x7f, - 0xbd, 0x2b, 0xfd, 0x6f, 0x40, 0xa2, 0xbd, 0x51, 0xaf, 0xda, 0xf7, 0x5d, 0x91, 0x32, 0xf1, 0x73, - 0x23, 0x44, 0xcf, 0x6b, 0x34, 0x9a, 0xb0, 0xda, 0xc2, 0x7d, 0x03, 0x30, 0x17, 0x3b, 0xd4, 0x03, - 0x74, 0x41, 0x7e, 0x76, 0x7c, 0x5a, 0x14, 0xf5, 0x62, 0x59, 0xaa, 0xc8, 0xf5, 0x2b, 0x55, 0x91, - 0x72, 0x5a, 0xb5, 0xaa, 0xa8, 0x5a, 0xb5, 0xe9, 0x13, 0x4f, 0xaf, 0xd1, 0xcd, 0x7e, 0x3d, 0x2a, - 0xfd, 0xff, 0x23, 0x36, 0xa3, 0x00, 0x43, 0x16, 0xfe, 0xe9, 0x02, 0x5e, 0x03, 0x6b, 0x22, 0x6a, - 0xba, 0x9b, 0x8d, 0xb0, 0xe7, 0xbb, 0x6a, 0x96, 0x05, 0x7c, 0x89, 0x2b, 0xa8, 0x59, 0x8b, 0x8a, - 0x69, 0x66, 0x0f, 0x70, 0x18, 0x2d, 0x4b, 0x51, 0x8e, 0x67, 0x56, 0xa8, 0x4f, 0xe5, 0x68, 0x6d, - 0x86, 0x0b, 0xfb, 0x7b, 0x18, 0x8d, 0x86, 0x38, 0x54, 0x41, 0x39, 0x55, 0x91, 0xeb, 0xff, 0x9d, - 0x2b, 0xf6, 0x63, 0x6e, 0x65, 0x0a, 0x23, 0x3d, 0x4d, 0x43, 0x33, 0x94, 0x83, 0x79, 0x71, 0x08, - 0x9b, 0x80, 0x67, 0xcc, 0xa6, 0x4c, 0x53, 0x65, 0x96, 0x21, 0xad, 0xca, 0x69, 0x58, 0x9d, 0xd1, - 0xb0, 0x6a, 0xcd, 0x68, 0xa8, 0x67, 0xa9, 0x9f, 0x57, 0x47, 0x25, 0xc9, 0xc8, 0x31, 0x1c, 0xd5, - 0xc0, 0x06, 0xc8, 0x61, 0x0f, 0x31, 0x17, 0xa1, 0x9a, 0x67, 0xa7, 0xf9, 0x38, 0x1f, 0x59, 0xec, - 0x21, 0x26, 0x87, 0x75, 0x90, 0x09, 0x23, 0x27, 0x1a, 0x85, 0xea, 0x0a, 0xa3, 0xae, 0xb6, 0x8c, - 0xba, 0x26, 0xb3, 0x30, 0x84, 0xe5, 0x5d, 0xe5, 0xe5, 0x4f, 0xa5, 0xc4, 0x9b, 0xdf, 0x6f, 0x64, - 0x85, 0xba, 0xb3, 0x79, 0x24, 0x81, 0xb5, 0x2d, 0x72, 0x88, 0x11, 0x23, 0xc0, 0xac, 0x49, 0x1a, - 0x20, 0x4f, 0x6b, 0x6d, 0x0b, 0x66, 0xb3, 0x76, 0x91, 0x17, 0x9a, 0x23, 0xd6, 0x54, 0x7a, 0xfa, - 0xed, 0xbb, 0x92, 0x64, 0xc8, 0xbd, 0x58, 0x9f, 0x7d, 0x2b, 0x81, 0x8d, 0x00, 0xbb, 0x0e, 0xf1, - 0x58, 0xea, 0xe3, 0xac, 0x4a, 0x9e, 0x3b, 0xab, 0x0a, 0xc7, 0x3b, 0x99, 0x27, 0xf4, 0xba, 0x9b, - 0xa6, 0xd1, 0x6e, 0x7e, 0x9f, 0x02, 0x79, 0xdd, 0x89, 0xfa, 0x7b, 0xe7, 0x18, 0x9c, 0x01, 0x56, - 0x5c, 0xe2, 0xd9, 0x3d, 0x82, 0x44, 0xeb, 0x25, 0xcf, 0xd4, 0x7a, 0xb2, 0x4b, 0x3c, 0x9d, 0xf0, - 0xd4, 0x43, 0x13, 0xac, 0xb8, 0xf4, 0x98, 0x78, 0xe6, 0x33, 0x75, 0x26, 0x9f, 0x79, 0xe1, 0x84, - 0x3b, 0xbd, 0x0e, 0xa0, 0xeb, 0x1c, 0xda, 0xf8, 0x30, 0xc2, 0x1e, 0xc2, 0xc8, 0x0e, 0xfc, 0x91, - 0x87, 0xd8, 0x28, 0x5a, 0x31, 0x14, 0xd7, 0x39, 0x6c, 0x0b, 0x85, 0x41, 0xe5, 0xf0, 0x29, 0xb8, - 0x3c, 0x6f, 0x69, 0x07, 0x4e, 0x84, 0xf9, 0x08, 0xfa, 0xe4, 0x83, 0xac, 0xe1, 0xb8, 0x6f, 0xc3, - 0x89, 0xb0, 0x28, 0xc8, 0xcf, 0x12, 0xb8, 0xb4, 0xd0, 0x6c, 0xf0, 0x1e, 0xc8, 0x07, 0x78, 0x88, - 0x69, 0x59, 0x58, 0x5b, 0x49, 0x9f, 0xd0, 0x56, 0xb2, 0x40, 0xb2, 0xc6, 0xda, 0x02, 0x99, 0x17, - 0x98, 0x0c, 0xf6, 0xa2, 0x33, 0x96, 0x44, 0xa0, 0x37, 0x7f, 0x4c, 0x82, 0xbc, 0x38, 0xe4, 0x57, - 0x23, 0x3c, 0xc2, 0xf0, 0xea, 0xf1, 0xe4, 0xb7, 0x8f, 0xef, 0x8f, 0x9c, 0x90, 0x74, 0xd0, 0xc2, - 0xc5, 0x90, 0x3c, 0x75, 0x31, 0x3c, 0x07, 0x72, 0x6c, 0xd4, 0xb1, 0xda, 0x9e, 0x6f, 0x0b, 0x80, - 0x93, 0x81, 0x79, 0x2a, 0x9b, 0xe9, 0xb3, 0x66, 0x53, 0x03, 0x59, 0xb1, 0x44, 0x8c, 0x05, 0x59, - 0xe3, 0x78, 0xbd, 0xf9, 0x9d, 0x04, 0x56, 0x1a, 0xc3, 0xa1, 0xff, 0x02, 0x23, 0x9d, 0x20, 0x84, - 0x03, 0xb8, 0x01, 0x32, 0x3d, 0xf6, 0xc5, 0xd2, 0x93, 0x33, 0xc4, 0x0a, 0x5a, 0x60, 0x95, 0x92, - 0x90, 0x76, 0x8b, 0xe3, 0xfa, 0x23, 0xef, 0x2c, 0xb5, 0xe9, 0x78, 0x11, 0xa5, 0xf6, 0xa1, 0x4e, - 0x50, 0x83, 0xf9, 0x10, 0x64, 0xfa, 0x23, 0x09, 0x52, 0x3a, 0x41, 0xff, 0x56, 0x9e, 0x93, 0xa3, - 0x25, 0xe7, 0x8e, 0xc6, 0x5f, 0x03, 0xa9, 0xe3, 0xd7, 0x40, 0x45, 0xbc, 0x06, 0xd2, 0x6c, 0xa4, - 0x16, 0xe6, 0x67, 0x02, 0x41, 0xb1, 0x97, 0x40, 0x0b, 0x5c, 0xe0, 0x6d, 0x7a, 0xb6, 0xee, 0xe0, - 0x60, 0xf8, 0x14, 0xa4, 0x19, 0x1f, 0x32, 0xe7, 0xce, 0x07, 0xe6, 0x97, 0xa6, 0x85, 0x84, 0xb6, - 0x18, 0x09, 0xec, 0x3a, 0xcf, 0x1a, 0x39, 0x12, 0x3e, 0xe4, 0x02, 0x9e, 0xc3, 0x6b, 0xbf, 0x49, - 0x40, 0x8e, 0x3d, 0x75, 0xe0, 0x4d, 0xa0, 0x36, 0x1e, 0x35, 0xad, 0xce, 0x76, 0xd7, 0xb6, 0x76, - 0x77, 0xda, 0xf6, 0xa3, 0xae, 0xb9, 0xd3, 0x6e, 0x76, 0xb6, 0x3a, 0xed, 0x96, 0x92, 0xd0, 0xe0, - 0x64, 0x5a, 0x5e, 0x8d, 0x99, 0x77, 0xc9, 0x10, 0x7e, 0xb1, 0x80, 0xd8, 0xea, 0x7c, 0xdd, 0x6e, - 0xd9, 0x3b, 0x46, 0xa7, 0xd9, 0x56, 0x24, 0xed, 0xca, 0x64, 0x5a, 0x5e, 0x8f, 0x21, 0x4e, 0xee, - 0x1b, 0x3a, 0x9f, 0xe6, 0x80, 0x7a, 0xc3, 0x6a, 0xde, 0x57, 0x92, 0x5a, 0x61, 0x32, 0x2d, 0x2b, - 0x31, 0x08, 0x1b, 0xe0, 0x5a, 0xfa, 0xe5, 0x2f, 0xc5, 0xc4, 0xb5, 0xa3, 0x24, 0x58, 0x99, 0xbb, - 0xde, 0xe0, 0x1d, 0xa0, 0xcd, 0xbc, 0x98, 0x56, 0xc3, 0x7a, 0x64, 0x2e, 0x1c, 0x39, 0xee, 0x8d, - 0x43, 0xe8, 0xa1, 0xef, 0x80, 0x8d, 0x05, 0x94, 0x69, 0x35, 0xba, 0x2d, 0x7d, 0x57, 0x91, 0x34, - 0x75, 0x32, 0x2d, 0x17, 0xe6, 0x10, 0x66, 0xe4, 0x78, 0x48, 0x1f, 0x2f, 0x47, 0x19, 0x56, 0xbb, - 0xa5, 0x24, 0x97, 0xa3, 0x82, 0x08, 0xa3, 0x25, 0xa8, 0xc7, 0x6d, 0xd3, 0xea, 0x74, 0xef, 0x29, - 0xa9, 0x25, 0x28, 0x31, 0x78, 0xe8, 0x9b, 0x67, 0x01, 0xb5, 0xd5, 0xe9, 0x76, 0xcc, 0xfb, 0xed, - 0x96, 0x92, 0x9e, 0xcb, 0x2a, 0x87, 0x6d, 0x11, 0x8f, 0x84, 0x7b, 0x18, 0xc1, 0x2f, 0x4f, 0xca, - 0x21, 0x70, 0xcd, 0x46, 0xb7, 0xd9, 0x7e, 0xf0, 0xa0, 0xdd, 0x52, 0x2e, 0x68, 0xda, 0x64, 0x5a, - 0xde, 0x98, 0x03, 0x36, 0x1d, 0xaf, 0x8f, 0x87, 0x43, 0x8c, 0x44, 0x86, 0xdf, 0x48, 0xe0, 0xa2, - 0x60, 0x3b, 0xac, 0x80, 0x82, 0xde, 0x69, 0x2d, 0x23, 0xc2, 0xea, 0x64, 0x5a, 0x06, 0xc2, 0x8c, - 0xe6, 0xb3, 0x16, 0xb3, 0x9c, 0x27, 0xc0, 0xfa, 0x64, 0x5a, 0x5e, 0x13, 0x96, 0xb1, 0xe2, 0xc7, - 0x01, 0xac, 0xf0, 0xf6, 0x93, 0x6d, 0xc3, 0xa2, 0xe5, 0x8f, 0x03, 0x58, 0xe9, 0x9f, 0xf8, 0x41, - 0xb4, 0x07, 0x6f, 0x80, 0xcb, 0x0b, 0x80, 0x87, 0x8d, 0xee, 0xae, 0x92, 0xe2, 0x05, 0x8e, 0xdb, - 0x3f, 0x74, 0xbc, 0xb1, 0x08, 0x66, 0x0c, 0x64, 0xf1, 0x16, 0x64, 0xf1, 0xdc, 0x02, 0xeb, 0x8d, - 0x56, 0xcb, 0x68, 0x9b, 0x26, 0xf7, 0x73, 0xbb, 0x6e, 0xeb, 0xbb, 0x56, 0xdb, 0x54, 0x12, 0xda, - 0xc6, 0x64, 0x5a, 0x86, 0x31, 0xdb, 0xdb, 0x75, 0x7d, 0x1c, 0xe1, 0xf0, 0x14, 0xa4, 0x7e, 0x53, - 0x40, 0xa4, 0x53, 0x90, 0xfa, 0x4d, 0x06, 0xe1, 0x5b, 0xeb, 0xdb, 0xaf, 0xdf, 0x17, 0xa5, 0xb7, - 0xef, 0x8b, 0xd2, 0xdf, 0xef, 0x8b, 0xd2, 0xab, 0x0f, 0xc5, 0xc4, 0xdb, 0x0f, 0xc5, 0xc4, 0x9f, - 0x1f, 0x8a, 0x89, 0x6f, 0x3e, 0x8b, 0xb5, 0x31, 0xbb, 0x25, 0x03, 0x97, 0x78, 0x51, 0xfc, 0xdf, - 0x53, 0xed, 0x70, 0x6e, 0xc5, 0x3a, 0xbb, 0x97, 0x61, 0xa3, 0xfb, 0xf6, 0x3f, 0x01, 0x00, 0x00, - 0xff, 0xff, 0xf2, 0x12, 0xc8, 0x12, 0x73, 0x0d, 0x00, 0x00, -} - -func (m *BaseAuction) 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 *BaseAuction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BaseAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Status != 0 { - i = encodeVarintFundraising(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x68 - } - if len(m.EndTimes) > 0 { - for iNdEx := len(m.EndTimes) - 1; iNdEx >= 0; iNdEx-- { - n, err := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndTimes[iNdEx], dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTimes[iNdEx]):]) - if err != nil { - return 0, err - } - i -= n - i = encodeVarintFundraising(dAtA, i, uint64(n)) - i-- - dAtA[i] = 0x62 - } - } - n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintFundraising(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x5a - if len(m.VestingSchedules) > 0 { - for iNdEx := len(m.VestingSchedules) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.VestingSchedules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintFundraising(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - } - if len(m.VestingReserveAddress) > 0 { - i -= len(m.VestingReserveAddress) - copy(dAtA[i:], m.VestingReserveAddress) - i = encodeVarintFundraising(dAtA, i, uint64(len(m.VestingReserveAddress))) - i-- - dAtA[i] = 0x4a - } - if len(m.PayingCoinDenom) > 0 { - i -= len(m.PayingCoinDenom) - copy(dAtA[i:], m.PayingCoinDenom) - i = encodeVarintFundraising(dAtA, i, uint64(len(m.PayingCoinDenom))) - i-- - dAtA[i] = 0x42 - } - { - size, err := m.SellingCoin.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintFundraising(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - { - size := m.StartPrice.Size() - i -= size - if _, err := m.StartPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintFundraising(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - if len(m.PayingReserveAddress) > 0 { - i -= len(m.PayingReserveAddress) - copy(dAtA[i:], m.PayingReserveAddress) - i = encodeVarintFundraising(dAtA, i, uint64(len(m.PayingReserveAddress))) - i-- - dAtA[i] = 0x2a - } - if len(m.SellingReserveAddress) > 0 { - i -= len(m.SellingReserveAddress) - copy(dAtA[i:], m.SellingReserveAddress) - i = encodeVarintFundraising(dAtA, i, uint64(len(m.SellingReserveAddress))) - i-- - dAtA[i] = 0x22 - } - if len(m.Auctioneer) > 0 { - i -= len(m.Auctioneer) - copy(dAtA[i:], m.Auctioneer) - i = encodeVarintFundraising(dAtA, i, uint64(len(m.Auctioneer))) - i-- - dAtA[i] = 0x1a - } - if m.Type != 0 { - i = encodeVarintFundraising(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x10 - } - if m.Id != 0 { - i = encodeVarintFundraising(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *FixedPriceAuction) 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 *FixedPriceAuction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FixedPriceAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.RemainingSellingCoin.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintFundraising(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.BaseAuction != nil { - { - size, err := m.BaseAuction.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintFundraising(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *BatchAuction) 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 *BatchAuction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BatchAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.ExtendedRoundRate.Size() - i -= size - if _, err := m.ExtendedRoundRate.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintFundraising(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if m.MaxExtendedRound != 0 { - i = encodeVarintFundraising(dAtA, i, uint64(m.MaxExtendedRound)) - i-- - dAtA[i] = 0x20 - } - { - size := m.MatchedPrice.Size() - i -= size - if _, err := m.MatchedPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintFundraising(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size := m.MinBidPrice.Size() - i -= size - if _, err := m.MinBidPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintFundraising(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.BaseAuction != nil { - { - size, err := m.BaseAuction.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintFundraising(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *VestingSchedule) 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 *VestingSchedule) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VestingSchedule) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Weight.Size() - i -= size - if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintFundraising(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.ReleaseTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ReleaseTime):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintFundraising(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *VestingQueue) 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 *VestingQueue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VestingQueue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Released { - i-- - if m.Released { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - n7, err7 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.ReleaseTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ReleaseTime):]) - if err7 != nil { - return 0, err7 - } - i -= n7 - i = encodeVarintFundraising(dAtA, i, uint64(n7)) - i-- - dAtA[i] = 0x22 - { - size, err := m.PayingCoin.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintFundraising(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Auctioneer) > 0 { - i -= len(m.Auctioneer) - copy(dAtA[i:], m.Auctioneer) - i = encodeVarintFundraising(dAtA, i, uint64(len(m.Auctioneer))) - i-- - dAtA[i] = 0x12 - } - if m.AuctionId != 0 { - i = encodeVarintFundraising(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *AllowedBidder) 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 *AllowedBidder) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AllowedBidder) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.MaxBidAmount.Size() - i -= size - if _, err := m.MaxBidAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintFundraising(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintFundraising(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Bid) 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 *Bid) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.IsMatched { - i-- - if m.IsMatched { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - } - { - size, err := m.Coin.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintFundraising(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - { - size := m.Price.Size() - i -= size - if _, err := m.Price.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintFundraising(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if m.Type != 0 { - i = encodeVarintFundraising(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x20 - } - if m.Id != 0 { - i = encodeVarintFundraising(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x18 - } - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintFundraising(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0x12 - } - if m.AuctionId != 0 { - i = encodeVarintFundraising(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintFundraising(dAtA []byte, offset int, v uint64) int { - offset -= sovFundraising(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *BaseAuction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovFundraising(uint64(m.Id)) - } - if m.Type != 0 { - n += 1 + sovFundraising(uint64(m.Type)) - } - l = len(m.Auctioneer) - if l > 0 { - n += 1 + l + sovFundraising(uint64(l)) - } - l = len(m.SellingReserveAddress) - if l > 0 { - n += 1 + l + sovFundraising(uint64(l)) - } - l = len(m.PayingReserveAddress) - if l > 0 { - n += 1 + l + sovFundraising(uint64(l)) - } - l = m.StartPrice.Size() - n += 1 + l + sovFundraising(uint64(l)) - l = m.SellingCoin.Size() - n += 1 + l + sovFundraising(uint64(l)) - l = len(m.PayingCoinDenom) - if l > 0 { - n += 1 + l + sovFundraising(uint64(l)) - } - l = len(m.VestingReserveAddress) - if l > 0 { - n += 1 + l + sovFundraising(uint64(l)) - } - if len(m.VestingSchedules) > 0 { - for _, e := range m.VestingSchedules { - l = e.Size() - n += 1 + l + sovFundraising(uint64(l)) - } - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime) - n += 1 + l + sovFundraising(uint64(l)) - if len(m.EndTimes) > 0 { - for _, e := range m.EndTimes { - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(e) - n += 1 + l + sovFundraising(uint64(l)) - } - } - if m.Status != 0 { - n += 1 + sovFundraising(uint64(m.Status)) - } - return n -} - -func (m *FixedPriceAuction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BaseAuction != nil { - l = m.BaseAuction.Size() - n += 1 + l + sovFundraising(uint64(l)) - } - l = m.RemainingSellingCoin.Size() - n += 1 + l + sovFundraising(uint64(l)) - return n -} - -func (m *BatchAuction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BaseAuction != nil { - l = m.BaseAuction.Size() - n += 1 + l + sovFundraising(uint64(l)) - } - l = m.MinBidPrice.Size() - n += 1 + l + sovFundraising(uint64(l)) - l = m.MatchedPrice.Size() - n += 1 + l + sovFundraising(uint64(l)) - if m.MaxExtendedRound != 0 { - n += 1 + sovFundraising(uint64(m.MaxExtendedRound)) - } - l = m.ExtendedRoundRate.Size() - n += 1 + l + sovFundraising(uint64(l)) - return n -} - -func (m *VestingSchedule) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ReleaseTime) - n += 1 + l + sovFundraising(uint64(l)) - l = m.Weight.Size() - n += 1 + l + sovFundraising(uint64(l)) - return n -} - -func (m *VestingQueue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AuctionId != 0 { - n += 1 + sovFundraising(uint64(m.AuctionId)) - } - l = len(m.Auctioneer) - if l > 0 { - n += 1 + l + sovFundraising(uint64(l)) - } - l = m.PayingCoin.Size() - n += 1 + l + sovFundraising(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ReleaseTime) - n += 1 + l + sovFundraising(uint64(l)) - if m.Released { - n += 2 - } - return n -} - -func (m *AllowedBidder) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovFundraising(uint64(l)) - } - l = m.MaxBidAmount.Size() - n += 1 + l + sovFundraising(uint64(l)) - return n -} - -func (m *Bid) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AuctionId != 0 { - n += 1 + sovFundraising(uint64(m.AuctionId)) - } - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovFundraising(uint64(l)) - } - if m.Id != 0 { - n += 1 + sovFundraising(uint64(m.Id)) - } - if m.Type != 0 { - n += 1 + sovFundraising(uint64(m.Type)) - } - l = m.Price.Size() - n += 1 + l + sovFundraising(uint64(l)) - l = m.Coin.Size() - n += 1 + l + sovFundraising(uint64(l)) - if m.IsMatched { - n += 2 - } - return n -} - -func sovFundraising(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozFundraising(x uint64) (n int) { - return sovFundraising(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *BaseAuction) 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 ErrIntOverflowFundraising - } - 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: BaseAuction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BaseAuction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= AuctionType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Auctioneer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - 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 ErrInvalidLengthFundraising - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Auctioneer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SellingReserveAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - 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 ErrInvalidLengthFundraising - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SellingReserveAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PayingReserveAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - 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 ErrInvalidLengthFundraising - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PayingReserveAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartPrice", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - 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 ErrInvalidLengthFundraising - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StartPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SellingCoin", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFundraising - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.SellingCoin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PayingCoinDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - 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 ErrInvalidLengthFundraising - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PayingCoinDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VestingReserveAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - 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 ErrInvalidLengthFundraising - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VestingReserveAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VestingSchedules", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFundraising - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VestingSchedules = append(m.VestingSchedules, VestingSchedule{}) - if err := m.VestingSchedules[len(m.VestingSchedules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - 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 ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFundraising - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - 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 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTimes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFundraising - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EndTimes = append(m.EndTimes, time.Time{}) - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&(m.EndTimes[len(m.EndTimes)-1]), dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= AuctionStatus(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipFundraising(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthFundraising - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FixedPriceAuction) 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 ErrIntOverflowFundraising - } - 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: FixedPriceAuction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FixedPriceAuction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseAuction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFundraising - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BaseAuction == nil { - m.BaseAuction = &BaseAuction{} - } - if err := m.BaseAuction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RemainingSellingCoin", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFundraising - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.RemainingSellingCoin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipFundraising(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthFundraising - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BatchAuction) 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 ErrIntOverflowFundraising - } - 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: BatchAuction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BatchAuction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseAuction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFundraising - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BaseAuction == nil { - m.BaseAuction = &BaseAuction{} - } - if err := m.BaseAuction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinBidPrice", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - 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 ErrInvalidLengthFundraising - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.MinBidPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MatchedPrice", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - 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 ErrInvalidLengthFundraising - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.MatchedPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxExtendedRound", wireType) - } - m.MaxExtendedRound = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxExtendedRound |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExtendedRoundRate", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - 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 ErrInvalidLengthFundraising - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ExtendedRoundRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipFundraising(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthFundraising - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VestingSchedule) 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 ErrIntOverflowFundraising - } - 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: VestingSchedule: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VestingSchedule: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ReleaseTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFundraising - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.ReleaseTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - 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 ErrInvalidLengthFundraising - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipFundraising(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthFundraising - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VestingQueue) 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 ErrIntOverflowFundraising - } - 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: VestingQueue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VestingQueue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) - } - m.AuctionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Auctioneer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - 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 ErrInvalidLengthFundraising - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Auctioneer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PayingCoin", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFundraising - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PayingCoin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ReleaseTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFundraising - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.ReleaseTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Released", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Released = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipFundraising(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthFundraising - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AllowedBidder) 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 ErrIntOverflowFundraising - } - 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: AllowedBidder: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AllowedBidder: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - 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 ErrInvalidLengthFundraising - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxBidAmount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - 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 ErrInvalidLengthFundraising - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.MaxBidAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipFundraising(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthFundraising - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Bid) 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 ErrIntOverflowFundraising - } - 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: Bid: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Bid: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) - } - m.AuctionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - 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 ErrInvalidLengthFundraising - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= BidType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - 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 ErrInvalidLengthFundraising - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Coin", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFundraising - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFundraising - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Coin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsMatched", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFundraising - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsMatched = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipFundraising(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthFundraising - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipFundraising(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, ErrIntOverflowFundraising - } - 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, ErrIntOverflowFundraising - } - 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, ErrIntOverflowFundraising - } - 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, ErrInvalidLengthFundraising - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupFundraising - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthFundraising - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthFundraising = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowFundraising = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupFundraising = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/fundraising/types/genesis.go b/x/fundraising/types/genesis.go index 5967cf6d..6b473f66 100644 --- a/x/fundraising/types/genesis.go +++ b/x/fundraising/types/genesis.go @@ -5,65 +5,87 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -// DefaultGenesisState returns the default fundraising genesis state -func DefaultGenesisState() *GenesisState { +// DefaultIndex is the default global index +const DefaultIndex uint64 = 1 + +// DefaultGenesis returns the default genesis state +func DefaultGenesis() *GenesisState { return &GenesisState{ - Params: DefaultParams(), - Auctions: []*codectypes.Any{}, - AllowedBidderRecords: []AllowedBidderRecord{}, - Bids: []Bid{}, - VestingQueues: []VestingQueue{}, + AllowedBidderList: []AllowedBidder{}, + VestingQueueList: []VestingQueue{}, + BidList: []Bid{}, + AuctionList: []*codectypes.Any{}, + // this line is used by starport scaffolding # genesis/types/default + Params: DefaultParams(), } } // Validate performs basic genesis state validation returning an error upon any // failure. func (gs GenesisState) Validate() error { - if err := gs.Params.Validate(); err != nil { - return err - } + // Check for duplicated index in allowedBidder + allowedBidderIndexMap := make(map[string]struct{}) - for _, a := range gs.Auctions { - auction, err := UnpackAuction(a) - if err != nil { - return err + for _, elem := range gs.AllowedBidderList { + index := fmt.Sprint(elem.AuctionId) + if _, ok := allowedBidderIndexMap[index]; ok { + return fmt.Errorf("duplicated index for allowedBidder") } + allowedBidderIndexMap[index] = struct{}{} - if err := auction.Validate(); err != nil { + if err := elem.Validate(); err != nil { return err } } + // Check for duplicated index in vestingQueue + vestingQueueIndexMap := make(map[string]struct{}) + + for _, elem := range gs.VestingQueueList { + index := fmt.Sprint(elem.AuctionId) + if _, ok := vestingQueueIndexMap[index]; ok { + return fmt.Errorf("duplicated index for vestingQueue") + } + vestingQueueIndexMap[index] = struct{}{} - for _, r := range gs.AllowedBidderRecords { - if err := r.Validate(); err != nil { + if err := elem.Validate(); err != nil { return err } } + // Check for duplicated ID in bid + bidIdMap := make(map[uint64]bool) + for _, elem := range gs.BidList { + if _, ok := bidIdMap[elem.Id]; ok { + return fmt.Errorf("duplicated id for bid") + } + bidIdMap[elem.Id] = true - for _, b := range gs.Bids { - if err := b.Validate(); err != nil { + if err := elem.Validate(); err != nil { return err } } - for _, q := range gs.VestingQueues { - if err := q.Validate(); err != nil { + // Check for duplicated ID in auction + auctionIdMap := make(map[uint64]bool) + for _, elem := range gs.AuctionList { + auction, err := UnpackAuction(elem) + if err != nil { + return err + } + if _, ok := auctionIdMap[auction.GetId()]; ok { + return fmt.Errorf("duplicated id for auction") + } + auctionIdMap[auction.GetId()] = true + + if err := auction.Validate(); err != nil { return err } } - return nil -} + // this line is used by starport scaffolding # genesis/types/validate -// Validate validates AllowedBidder. -func (r AllowedBidderRecord) Validate() error { - if r.AuctionId == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "auction id cannot be 0") - } - return r.AllowedBidder.Validate() + return gs.Params.Validate() } // Validate validates Bid. diff --git a/x/fundraising/types/genesis.pb.go b/x/fundraising/types/genesis.pb.go index 16d43be9..34838557 100644 --- a/x/fundraising/types/genesis.pb.go +++ b/x/fundraising/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: fundraising/genesis.proto +// source: fundraising/fundraising/v1/genesis.proto package types @@ -7,6 +7,7 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -27,25 +28,24 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the fundraising module's genesis state. type GenesisState struct { - // params defines all the parameters for the module + // params defines all the parameters of the module. Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - // auctions define the auction interface for genesis state; the module + // auctionList define the auction interface for genesis state; the module // supports FixedPriceAuction or BatchAuction - Auctions []*types.Any `protobuf:"bytes,2,rep,name=auctions,proto3" json:"auctions,omitempty"` - // allowed_bidder_records define the allowed bidder records for the auction - AllowedBidderRecords []AllowedBidderRecord `protobuf:"bytes,3,rep,name=allowed_bidder_records,json=allowedBidderRecords,proto3" json:"allowed_bidder_records"` - // bids define the bid records used for genesis state - Bids []Bid `protobuf:"bytes,4,rep,name=bids,proto3" json:"bids"` - // vesting_queues define the vesting queue records used for genesis - // state - VestingQueues []VestingQueue `protobuf:"bytes,5,rep,name=vesting_queues,json=vestingQueues,proto3" json:"vesting_queues"` + AuctionList []*types.Any `protobuf:"bytes,2,rep,name=auctionList,proto3" json:"auctionList,omitempty"` + // allowedBidderList define the allowed bidder records for the auction + AllowedBidderList []AllowedBidder `protobuf:"bytes,3,rep,name=allowedBidderList,proto3" json:"allowedBidderList"` + // bidList define the bid records used for genesis state + BidList []Bid `protobuf:"bytes,4,rep,name=bidList,proto3" json:"bidList"` + // vestingQueueList define the vesting queue records used for genesis state + VestingQueueList []VestingQueue `protobuf:"bytes,5,rep,name=vestingQueueList,proto3" json:"vestingQueueList"` } 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_a35424efc9855161, []int{0} + return fileDescriptor_e9af9a15032fb486, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -74,96 +74,78 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo -type AllowedBidderRecord struct { - // auction_ id specifies index of the auction - AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` - // allowed_bidder specifies allowed bidder for the auction - AllowedBidder AllowedBidder `protobuf:"bytes,2,opt,name=allowed_bidder,json=allowedBidder,proto3" json:"allowed_bidder"` +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} } -func (m *AllowedBidderRecord) Reset() { *m = AllowedBidderRecord{} } -func (m *AllowedBidderRecord) String() string { return proto.CompactTextString(m) } -func (*AllowedBidderRecord) ProtoMessage() {} -func (*AllowedBidderRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_a35424efc9855161, []int{1} -} -func (m *AllowedBidderRecord) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AllowedBidderRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AllowedBidderRecord.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) GetAuctionList() []*types.Any { + if m != nil { + return m.AuctionList } -} -func (m *AllowedBidderRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllowedBidderRecord.Merge(m, src) -} -func (m *AllowedBidderRecord) XXX_Size() int { - return m.Size() -} -func (m *AllowedBidderRecord) XXX_DiscardUnknown() { - xxx_messageInfo_AllowedBidderRecord.DiscardUnknown(m) + return nil } -var xxx_messageInfo_AllowedBidderRecord proto.InternalMessageInfo +func (m *GenesisState) GetAllowedBidderList() []AllowedBidder { + if m != nil { + return m.AllowedBidderList + } + return nil +} -func (m *AllowedBidderRecord) GetAuctionId() uint64 { +func (m *GenesisState) GetBidList() []Bid { if m != nil { - return m.AuctionId + return m.BidList } - return 0 + return nil } -func (m *AllowedBidderRecord) GetAllowedBidder() AllowedBidder { +func (m *GenesisState) GetVestingQueueList() []VestingQueue { if m != nil { - return m.AllowedBidder + return m.VestingQueueList } - return AllowedBidder{} + return nil } func init() { - proto.RegisterType((*GenesisState)(nil), "fundraising.GenesisState") - proto.RegisterType((*AllowedBidderRecord)(nil), "fundraising.AllowedBidderRecord") + proto.RegisterType((*GenesisState)(nil), "fundraising.fundraising.v1.GenesisState") } -func init() { proto.RegisterFile("fundraising/genesis.proto", fileDescriptor_a35424efc9855161) } +func init() { + proto.RegisterFile("fundraising/fundraising/v1/genesis.proto", fileDescriptor_e9af9a15032fb486) +} -var fileDescriptor_a35424efc9855161 = []byte{ - // 429 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xb1, 0x8e, 0xd3, 0x30, - 0x18, 0xc7, 0x93, 0x5e, 0x38, 0x15, 0xf7, 0x38, 0x21, 0x5f, 0x85, 0x92, 0x4a, 0x97, 0x56, 0x37, - 0x9d, 0x90, 0x48, 0xc4, 0x21, 0x16, 0x06, 0xa4, 0x66, 0xe0, 0xd4, 0x09, 0x08, 0x12, 0x03, 0x42, - 0x8a, 0x9c, 0xd8, 0x35, 0x96, 0x1a, 0xbb, 0xc4, 0x4e, 0xa1, 0x03, 0x3b, 0x23, 0x8f, 0xd0, 0x87, - 0xe0, 0x21, 0x2a, 0xa6, 0x8e, 0x2c, 0x20, 0xd4, 0x2e, 0x3c, 0x06, 0xaa, 0xed, 0xa2, 0x44, 0x70, - 0x9b, 0xbf, 0xef, 0xff, 0xfb, 0x7f, 0xfe, 0xe7, 0x73, 0x40, 0x30, 0xad, 0x39, 0xae, 0x10, 0x93, - 0x8c, 0xd3, 0x98, 0x12, 0x4e, 0x24, 0x93, 0xd1, 0xbc, 0x12, 0x4a, 0xc0, 0x5e, 0x43, 0x1a, 0x04, - 0x85, 0x90, 0xa5, 0x90, 0x99, 0x96, 0x62, 0x53, 0x18, 0x6e, 0xd0, 0xa7, 0x82, 0x0a, 0xd3, 0xdf, - 0x9f, 0x6c, 0x37, 0xa0, 0x42, 0xd0, 0x19, 0x89, 0x75, 0x95, 0xd7, 0xd3, 0x18, 0xf1, 0xa5, 0x95, - 0xce, 0x9b, 0x77, 0x36, 0xce, 0x56, 0xf6, 0x9b, 0xf2, 0x1c, 0x55, 0xa8, 0xb4, 0x37, 0x5d, 0xfc, - 0xe8, 0x80, 0x93, 0x6b, 0x93, 0xf1, 0x95, 0x42, 0x8a, 0xc0, 0x87, 0xe0, 0xd8, 0x00, 0xbe, 0x3b, - 0x72, 0x2f, 0x7b, 0x57, 0x67, 0x51, 0x73, 0xdc, 0x0b, 0x2d, 0x25, 0xde, 0xfa, 0xe7, 0xd0, 0x49, - 0x2d, 0x08, 0x9f, 0x82, 0x2e, 0xaa, 0x0b, 0xc5, 0x04, 0x97, 0x7e, 0x67, 0x74, 0x74, 0xd9, 0xbb, - 0xea, 0x47, 0x26, 0x6a, 0x74, 0x88, 0x1a, 0x8d, 0xf9, 0x32, 0x39, 0xf9, 0xf6, 0xf5, 0x41, 0x77, - 0x6c, 0xc8, 0x49, 0xfa, 0xd7, 0x03, 0xdf, 0x82, 0x7b, 0x68, 0x36, 0x13, 0x1f, 0x08, 0xce, 0x72, - 0x86, 0x31, 0xa9, 0xb2, 0x8a, 0x14, 0xa2, 0xc2, 0xd2, 0x3f, 0xd2, 0xd3, 0x46, 0xad, 0x08, 0x63, - 0x83, 0x26, 0x9a, 0x4c, 0x35, 0x68, 0xf3, 0xf4, 0xd1, 0xbf, 0x92, 0x84, 0xf7, 0x81, 0x97, 0x33, - 0x2c, 0x7d, 0x4f, 0xcf, 0xba, 0xdb, 0x9a, 0x95, 0xb0, 0x83, 0x57, 0x33, 0xf0, 0x19, 0x38, 0x5d, - 0x10, 0xa9, 0x18, 0xa7, 0xd9, 0xfb, 0x9a, 0xd4, 0x44, 0xfa, 0xb7, 0xb4, 0x2b, 0x68, 0xb9, 0x5e, - 0x1b, 0xe4, 0xe5, 0x9e, 0xb0, 0xf6, 0x3b, 0x8b, 0x46, 0x4f, 0x3e, 0xe9, 0x7e, 0x5e, 0x0d, 0x9d, - 0xdf, 0xab, 0xa1, 0x73, 0xf1, 0x09, 0x9c, 0xfd, 0x27, 0x30, 0x3c, 0x07, 0xc0, 0x7e, 0x7e, 0xc6, - 0xb0, 0xde, 0xb4, 0x97, 0xde, 0xb6, 0x9d, 0x09, 0x86, 0xd7, 0xe0, 0xb4, 0xbd, 0x11, 0xbf, 0xa3, - 0x1f, 0x63, 0x70, 0xf3, 0x26, 0x0e, 0x41, 0x5a, 0x3b, 0x48, 0x9e, 0xaf, 0xb7, 0xa1, 0xbb, 0xd9, - 0x86, 0xee, 0xaf, 0x6d, 0xe8, 0x7e, 0xd9, 0x85, 0xce, 0x66, 0x17, 0x3a, 0xdf, 0x77, 0xa1, 0xf3, - 0xe6, 0x31, 0x65, 0xea, 0x5d, 0x9d, 0x47, 0x85, 0x28, 0x63, 0x45, 0x38, 0x26, 0x55, 0xc9, 0xb8, - 0x6a, 0xfe, 0x3b, 0xf1, 0xc7, 0x56, 0xa5, 0x96, 0x73, 0x22, 0xf3, 0x63, 0xfd, 0xa2, 0x8f, 0xfe, - 0x04, 0x00, 0x00, 0xff, 0xff, 0xc7, 0x66, 0xe1, 0xe9, 0xe5, 0x02, 0x00, 0x00, +var fileDescriptor_e9af9a15032fb486 = []byte{ + // 418 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0x41, 0xeb, 0xd3, 0x30, + 0x18, 0xc6, 0x5b, 0x37, 0xa7, 0x76, 0x3b, 0xb8, 0xb2, 0xc3, 0xdc, 0xa1, 0x1b, 0x43, 0xb0, 0x0a, + 0x26, 0x6c, 0xe2, 0x59, 0x56, 0x14, 0x11, 0x04, 0x75, 0x82, 0x87, 0x81, 0x8c, 0x74, 0xc9, 0x62, + 0x60, 0x4d, 0x66, 0x93, 0x4e, 0xf7, 0x2d, 0xbc, 0xf9, 0x15, 0x3c, 0x7a, 0xf0, 0x43, 0x0c, 0x4f, + 0x3b, 0x7a, 0x12, 0xd9, 0x0e, 0x7e, 0x8d, 0x3f, 0x4b, 0x52, 0xe8, 0x18, 0xff, 0x5c, 0xca, 0xfb, + 0xf2, 0x3e, 0xcf, 0xaf, 0x4f, 0xdf, 0xb7, 0x41, 0xbc, 0x2c, 0x38, 0xce, 0x11, 0x93, 0x8c, 0x53, + 0x58, 0xad, 0x37, 0x23, 0x48, 0x09, 0x27, 0x92, 0x49, 0xb0, 0xce, 0x85, 0x12, 0x61, 0xaf, 0x32, + 0x05, 0xd5, 0x7a, 0x33, 0xea, 0xb5, 0x51, 0xc6, 0xb8, 0x80, 0xfa, 0x69, 0xe4, 0xbd, 0x7b, 0x0b, + 0x21, 0x33, 0x21, 0xe7, 0xba, 0x83, 0xa6, 0xb1, 0x23, 0xe8, 0x78, 0x27, 0x5a, 0xad, 0xc4, 0x17, + 0x82, 0xe7, 0x29, 0xc3, 0x98, 0xe4, 0xd6, 0xe0, 0x0a, 0x89, 0x8a, 0x85, 0x62, 0x82, 0x5b, 0xe5, + 0x7d, 0x87, 0x32, 0x65, 0xd8, 0xaa, 0x1e, 0x38, 0x54, 0x6b, 0x94, 0xa3, 0xac, 0x4c, 0x0a, 0x1c, + 0xc2, 0x0d, 0x91, 0x8a, 0x71, 0x3a, 0xff, 0x5c, 0x90, 0x82, 0x58, 0x7d, 0x87, 0x0a, 0x2a, 0xcc, + 0x17, 0x9f, 0xaa, 0x72, 0x15, 0x54, 0x08, 0xba, 0x22, 0x50, 0x77, 0x69, 0xb1, 0x84, 0x88, 0x6f, + 0xcd, 0x68, 0xf8, 0xbd, 0x16, 0xb4, 0x5e, 0x9a, 0x35, 0xbf, 0x57, 0x48, 0x91, 0xf0, 0x45, 0xd0, + 0x30, 0x09, 0xba, 0xfe, 0xc0, 0x8f, 0x9b, 0xe3, 0x21, 0xb8, 0x7e, 0xed, 0xe0, 0xad, 0x56, 0x26, + 0x77, 0x76, 0x7f, 0xfb, 0xde, 0x8f, 0xff, 0x3f, 0x1f, 0xf9, 0x53, 0x6b, 0x0e, 0x9f, 0x07, 0x4d, + 0xbb, 0x98, 0xd7, 0x4c, 0xaa, 0xee, 0x8d, 0x41, 0x2d, 0x6e, 0x8e, 0x3b, 0xc0, 0x04, 0x01, 0x65, + 0x10, 0x30, 0xe1, 0xdb, 0xa4, 0xf5, 0xfb, 0xd7, 0xe3, 0xdb, 0x13, 0x23, 0x7e, 0x35, 0xad, 0xda, + 0xc2, 0x8f, 0x41, 0xdb, 0xde, 0x23, 0xd1, 0xe7, 0xd0, 0xac, 0x9a, 0x66, 0x3d, 0x74, 0xe5, 0x9a, + 0x54, 0x4d, 0x49, 0xfd, 0x14, 0x6f, 0x7a, 0x49, 0x0a, 0x9f, 0x05, 0xb7, 0x52, 0x86, 0x35, 0xb4, + 0xae, 0xa1, 0x7d, 0x17, 0x34, 0x61, 0xd8, 0xa2, 0x4a, 0x57, 0x38, 0x0b, 0xee, 0xda, 0x2b, 0xbc, + 0x3b, 0x1d, 0x41, 0x93, 0x6e, 0x6a, 0x52, 0xec, 0x22, 0x7d, 0xa8, 0x78, 0x2c, 0xf2, 0x82, 0x93, + 0xbc, 0xd9, 0x1d, 0x22, 0x7f, 0x7f, 0x88, 0xfc, 0x7f, 0x87, 0xc8, 0xff, 0x76, 0x8c, 0xbc, 0xfd, + 0x31, 0xf2, 0xfe, 0x1c, 0x23, 0x6f, 0xf6, 0x94, 0x32, 0xf5, 0xa9, 0x48, 0xc1, 0x42, 0x64, 0x50, + 0x11, 0x8e, 0x49, 0x9e, 0x31, 0xae, 0xce, 0x7e, 0x8f, 0xaf, 0x67, 0x9d, 0xda, 0xae, 0x89, 0x4c, + 0x1b, 0x7a, 0xeb, 0x4f, 0xae, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe4, 0xc6, 0x83, 0x0e, 0x72, 0x03, + 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -186,10 +168,10 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.VestingQueues) > 0 { - for iNdEx := len(m.VestingQueues) - 1; iNdEx >= 0; iNdEx-- { + if len(m.VestingQueueList) > 0 { + for iNdEx := len(m.VestingQueueList) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.VestingQueues[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.VestingQueueList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -200,10 +182,10 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x2a } } - if len(m.Bids) > 0 { - for iNdEx := len(m.Bids) - 1; iNdEx >= 0; iNdEx-- { + if len(m.BidList) > 0 { + for iNdEx := len(m.BidList) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Bids[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.BidList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -214,10 +196,10 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x22 } } - if len(m.AllowedBidderRecords) > 0 { - for iNdEx := len(m.AllowedBidderRecords) - 1; iNdEx >= 0; iNdEx-- { + if len(m.AllowedBidderList) > 0 { + for iNdEx := len(m.AllowedBidderList) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.AllowedBidderRecords[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.AllowedBidderList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -228,10 +210,10 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x1a } } - if len(m.Auctions) > 0 { - for iNdEx := len(m.Auctions) - 1; iNdEx >= 0; iNdEx-- { + if len(m.AuctionList) > 0 { + for iNdEx := len(m.AuctionList) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Auctions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.AuctionList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -255,44 +237,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *AllowedBidderRecord) 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 *AllowedBidderRecord) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AllowedBidderRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.AllowedBidder.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.AuctionId != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { offset -= sovGenesis(v) base := offset @@ -312,26 +256,26 @@ func (m *GenesisState) Size() (n int) { _ = l l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) - if len(m.Auctions) > 0 { - for _, e := range m.Auctions { + if len(m.AuctionList) > 0 { + for _, e := range m.AuctionList { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } - if len(m.AllowedBidderRecords) > 0 { - for _, e := range m.AllowedBidderRecords { + if len(m.AllowedBidderList) > 0 { + for _, e := range m.AllowedBidderList { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } - if len(m.Bids) > 0 { - for _, e := range m.Bids { + if len(m.BidList) > 0 { + for _, e := range m.BidList { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } - if len(m.VestingQueues) > 0 { - for _, e := range m.VestingQueues { + if len(m.VestingQueueList) > 0 { + for _, e := range m.VestingQueueList { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } @@ -339,20 +283,6 @@ func (m *GenesisState) Size() (n int) { return n } -func (m *AllowedBidderRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AuctionId != 0 { - n += 1 + sovGenesis(uint64(m.AuctionId)) - } - l = m.AllowedBidder.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - func sovGenesis(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -423,7 +353,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Auctions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AuctionList", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -450,14 +380,14 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Auctions = append(m.Auctions, &types.Any{}) - if err := m.Auctions[len(m.Auctions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.AuctionList = append(m.AuctionList, &types.Any{}) + if err := m.AuctionList[len(m.AuctionList)-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 AllowedBidderRecords", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AllowedBidderList", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -484,14 +414,14 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AllowedBidderRecords = append(m.AllowedBidderRecords, AllowedBidderRecord{}) - if err := m.AllowedBidderRecords[len(m.AllowedBidderRecords)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.AllowedBidderList = append(m.AllowedBidderList, AllowedBidder{}) + if err := m.AllowedBidderList[len(m.AllowedBidderList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bids", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BidList", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -518,117 +448,14 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Bids = append(m.Bids, Bid{}) - if err := m.Bids[len(m.Bids)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.BidList = append(m.BidList, Bid{}) + if err := m.BidList[len(m.BidList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VestingQueues", 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.VestingQueues = append(m.VestingQueues, VestingQueue{}) - if err := m.VestingQueues[len(m.VestingQueues)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AllowedBidderRecord) 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: AllowedBidderRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AllowedBidderRecord: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) - } - m.AuctionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowedBidder", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field VestingQueueList", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -655,7 +482,8 @@ func (m *AllowedBidderRecord) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AllowedBidder.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.VestingQueueList = append(m.VestingQueueList, VestingQueue{}) + if err := m.VestingQueueList[len(m.VestingQueueList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/fundraising/types/genesis_test.go b/x/fundraising/types/genesis_test.go index 067e3fd4..01130e26 100644 --- a/x/fundraising/types/genesis_test.go +++ b/x/fundraising/types/genesis_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + "cosmossdk.io/math" "github.com/cometbft/cometbft/crypto" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -21,18 +22,18 @@ func TestGenesisState_Validate(t *testing.T) { Auctioneer: validAddr.String(), SellingReserveAddress: types.SellingReserveAddress(1).String(), PayingReserveAddress: types.PayingReserveAddress(1).String(), - StartPrice: sdk.MustNewDecFromStr("0.5"), + StartPrice: math.LegacyMustNewDecFromStr("0.5"), SellingCoin: sdk.NewInt64Coin("denom1", 1_000_000_000_000), PayingCoinDenom: "denom2", VestingReserveAddress: types.VestingReserveAddress(1).String(), VestingSchedules: []types.VestingSchedule{ { ReleaseTime: types.MustParseRFC3339("2023-01-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.5"), + Weight: math.LegacyMustNewDecFromStr("0.5"), }, { ReleaseTime: types.MustParseRFC3339("2023-12-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.5"), + Weight: math.LegacyMustNewDecFromStr("0.5"), }, }, StartTime: types.MustParseRFC3339("2022-01-01T00:00:00Z"), @@ -43,15 +44,16 @@ func TestGenesisState_Validate(t *testing.T) { ) validAllowedBidder := types.AllowedBidder{ + AuctionId: 1, Bidder: validAddr.String(), - MaxBidAmount: sdk.NewInt(10_000_000), + MaxBidAmount: math.NewInt(10_000_000), } validBid := types.Bid{ AuctionId: 1, Id: 1, Bidder: validAddr.String(), - Price: sdk.MustNewDecFromStr("0.5"), + Price: math.LegacyMustNewDecFromStr("0.5"), Coin: sdk.NewInt64Coin("denom2", 50_000_000), } @@ -63,7 +65,7 @@ func TestGenesisState_Validate(t *testing.T) { Released: false, } - for _, tc := range []struct { + tests := []struct { desc string configure func(*types.GenesisState) valid bool @@ -83,15 +85,13 @@ func TestGenesisState_Validate(t *testing.T) { auctionAny, _ := types.PackAuction(validAuction) genState.Params = params - genState.Auctions = []*codectypes.Any{auctionAny} - genState.AllowedBidderRecords = []types.AllowedBidderRecord{ - { - AuctionId: 1, - AllowedBidder: validAllowedBidder, - }, - } - genState.Bids = []types.Bid{validBid} - genState.VestingQueues = []types.VestingQueue{validVestingQueue} + genState.AuctionList = []*codectypes.Any{auctionAny} + genState.AllowedBidderList = []types.AllowedBidder{validAllowedBidder} + genState.BidList = []types.Bid{validBid} + genState.VestingQueueList = []types.VestingQueue{validVestingQueue} + + // TODO fix when add a new field + // this line is used by starport scaffolding # types/genesis/validField }, valid: true, }, @@ -105,18 +105,18 @@ func TestGenesisState_Validate(t *testing.T) { Auctioneer: validAddr.String(), SellingReserveAddress: types.SellingReserveAddress(1).String(), PayingReserveAddress: types.PayingReserveAddress(1).String(), - StartPrice: sdk.MustNewDecFromStr("0.5"), + StartPrice: math.LegacyMustNewDecFromStr("0.5"), SellingCoin: sdk.NewInt64Coin("denom1", 1_000_000_000_000), PayingCoinDenom: "denom2", VestingReserveAddress: types.VestingReserveAddress(1).String(), VestingSchedules: []types.VestingSchedule{ { ReleaseTime: types.MustParseRFC3339("2023-01-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.5"), + Weight: math.LegacyMustNewDecFromStr("0.5"), }, { ReleaseTime: types.MustParseRFC3339("2023-06-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.5"), + Weight: math.LegacyMustNewDecFromStr("0.5"), }, }, StartTime: types.MustParseRFC3339("2021-12-10T00:00:00Z"), @@ -126,7 +126,7 @@ func TestGenesisState_Validate(t *testing.T) { sdk.NewInt64Coin("denom1", 1_000_000_000_000), )) - genState.Auctions = []*codectypes.Any{auctionAny} + genState.AuctionList = []*codectypes.Any{auctionAny} }, valid: false, }, @@ -140,18 +140,18 @@ func TestGenesisState_Validate(t *testing.T) { Auctioneer: validAddr.String(), SellingReserveAddress: types.SellingReserveAddress(1).String(), PayingReserveAddress: types.PayingReserveAddress(1).String(), - StartPrice: sdk.MustNewDecFromStr("0.5"), + StartPrice: math.LegacyMustNewDecFromStr("0.5"), SellingCoin: sdk.NewInt64Coin("denom1", 1_000_000_000_000), PayingCoinDenom: "denom1", VestingReserveAddress: types.VestingReserveAddress(1).String(), VestingSchedules: []types.VestingSchedule{ { ReleaseTime: types.MustParseRFC3339("2022-06-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.5"), + Weight: math.LegacyMustNewDecFromStr("0.5"), }, { ReleaseTime: types.MustParseRFC3339("2022-12-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.5"), + Weight: math.LegacyMustNewDecFromStr("0.5"), }, }, StartTime: types.MustParseRFC3339("2021-12-10T00:00:00Z"), @@ -161,7 +161,7 @@ func TestGenesisState_Validate(t *testing.T) { sdk.NewInt64Coin("denom1", 1_000_000_000_000), )) - genState.Auctions = []*codectypes.Any{auctionAny} + genState.AuctionList = []*codectypes.Any{auctionAny} }, valid: false, }, @@ -175,18 +175,18 @@ func TestGenesisState_Validate(t *testing.T) { Auctioneer: validAddr.String(), SellingReserveAddress: types.SellingReserveAddress(1).String(), PayingReserveAddress: types.PayingReserveAddress(1).String(), - StartPrice: sdk.MustNewDecFromStr("0.5"), + StartPrice: math.LegacyMustNewDecFromStr("0.5"), SellingCoin: sdk.NewInt64Coin("denom1", 1_000_000_000_000), PayingCoinDenom: "denom1", VestingReserveAddress: types.VestingReserveAddress(1).String(), VestingSchedules: []types.VestingSchedule{ { ReleaseTime: types.MustParseRFC3339("2022-06-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.9"), + Weight: math.LegacyMustNewDecFromStr("0.9"), }, { ReleaseTime: types.MustParseRFC3339("2022-12-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.5"), + Weight: math.LegacyMustNewDecFromStr("0.5"), }, }, StartTime: types.MustParseRFC3339("2021-12-10T00:00:00Z"), @@ -196,7 +196,7 @@ func TestGenesisState_Validate(t *testing.T) { sdk.NewInt64Coin("denom1", 1_000_000_000_000), )) - genState.Auctions = []*codectypes.Any{auctionAny} + genState.AuctionList = []*codectypes.Any{auctionAny} }, valid: false, }, @@ -210,18 +210,18 @@ func TestGenesisState_Validate(t *testing.T) { Auctioneer: "invalid", SellingReserveAddress: types.SellingReserveAddress(1).String(), PayingReserveAddress: types.PayingReserveAddress(1).String(), - StartPrice: sdk.MustNewDecFromStr("0.5"), + StartPrice: math.LegacyMustNewDecFromStr("0.5"), SellingCoin: sdk.NewInt64Coin("denom1", 1_000_000_000_000), PayingCoinDenom: "denom1", VestingReserveAddress: types.VestingReserveAddress(1).String(), VestingSchedules: []types.VestingSchedule{ { ReleaseTime: types.MustParseRFC3339("2022-06-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.9"), + Weight: math.LegacyMustNewDecFromStr("0.9"), }, { ReleaseTime: types.MustParseRFC3339("2022-12-01T00:00:00Z"), - Weight: sdk.MustNewDecFromStr("0.5"), + Weight: math.LegacyMustNewDecFromStr("0.5"), }, }, StartTime: types.MustParseRFC3339("2021-12-10T00:00:00Z"), @@ -231,19 +231,19 @@ func TestGenesisState_Validate(t *testing.T) { sdk.NewInt64Coin("denom1", 1_000_000_000_000), )) - genState.Auctions = []*codectypes.Any{auctionAny} + genState.AuctionList = []*codectypes.Any{auctionAny} }, valid: false, }, { desc: "invalid bid - invalid bidder address", configure: func(genState *types.GenesisState) { - genState.Bids = []types.Bid{ + genState.BidList = []types.Bid{ { AuctionId: 1, Id: 1, Bidder: "invalid", - Price: sdk.MustNewDecFromStr("0.5"), + Price: math.LegacyMustNewDecFromStr("0.5"), Coin: sdk.NewInt64Coin("denom2", 50_000_000), }, } @@ -253,12 +253,12 @@ func TestGenesisState_Validate(t *testing.T) { { desc: "invalid bid - invalid coin amount", configure: func(genState *types.GenesisState) { - genState.Bids = []types.Bid{ + genState.BidList = []types.Bid{ { AuctionId: 1, Id: 1, Bidder: validAddr.String(), - Price: sdk.MustNewDecFromStr("0.5"), + Price: math.LegacyMustNewDecFromStr("0.5"), Coin: sdk.NewInt64Coin("denom2", 0), }, } @@ -268,12 +268,12 @@ func TestGenesisState_Validate(t *testing.T) { { desc: "invalid bid - invalid price", configure: func(genState *types.GenesisState) { - genState.Bids = []types.Bid{ + genState.BidList = []types.Bid{ { AuctionId: 1, Id: 1, Bidder: validAddr.String(), - Price: sdk.MustNewDecFromStr("0"), + Price: math.LegacyMustNewDecFromStr("0"), Coin: sdk.NewInt64Coin("denom2", 100_000), }, } @@ -283,28 +283,11 @@ func TestGenesisState_Validate(t *testing.T) { { desc: "invalid allowed bidder - invalid max bid amount", configure: func(genState *types.GenesisState) { - genState.AllowedBidderRecords = []types.AllowedBidderRecord{ + genState.AllowedBidderList = []types.AllowedBidder{ { - AuctionId: 1, - AllowedBidder: types.AllowedBidder{ - Bidder: validAddr.String(), - MaxBidAmount: sdk.NewInt(0), - }, - }, - } - }, - valid: false, - }, - { - desc: "invalid allowed bidder - auction id cannot be 0", - configure: func(genState *types.GenesisState) { - genState.AllowedBidderRecords = []types.AllowedBidderRecord{ - { - AuctionId: 0, - AllowedBidder: types.AllowedBidder{ - Bidder: validAddr.String(), - MaxBidAmount: sdk.NewInt(100_000), - }, + AuctionId: 1, + Bidder: validAddr.String(), + MaxBidAmount: math.NewInt(0), }, } }, @@ -315,9 +298,9 @@ func TestGenesisState_Validate(t *testing.T) { configure: func(genState *types.GenesisState) { params := types.DefaultParams() genState.Params = params - genState.VestingQueues = []types.VestingQueue{ + genState.VestingQueueList = []types.VestingQueue{ { - AuctionId: 1, + AuctionId: 2, Auctioneer: "", PayingCoin: sdk.NewInt64Coin("denom2", 100_000_000), ReleaseTime: types.MustParseRFC3339("2022-12-20T00:00:00Z"), @@ -327,11 +310,12 @@ func TestGenesisState_Validate(t *testing.T) { }, valid: false, }, - } { + // this line is used by starport scaffolding # types/genesis/testcase + } + for _, tc := range tests { t.Run(tc.desc, func(t *testing.T) { - genState := types.DefaultGenesisState() + genState := types.DefaultGenesis() tc.configure(genState) - err := genState.Validate() if tc.valid { require.NoError(t, err) diff --git a/x/fundraising/types/hooks.go b/x/fundraising/types/hooks.go index aa7c459c..7f0e2785 100644 --- a/x/fundraising/types/hooks.go +++ b/x/fundraising/types/hooks.go @@ -3,12 +3,15 @@ package types // DONTCOVER import ( + "context" "time" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" ) +var _ FundraisingHooks = MultiFundraisingHooks{} + // MultiFundraisingHooks combines multiple fundraising hooks. // All hook functions are run in array sequence type MultiFundraisingHooks []FundraisingHooks @@ -18,15 +21,15 @@ func NewMultiFundraisingHooks(hooks ...FundraisingHooks) MultiFundraisingHooks { } func (h MultiFundraisingHooks) BeforeFixedPriceAuctionCreated( - ctx sdk.Context, + ctx context.Context, auctioneer string, - startPrice sdk.Dec, + startPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []VestingSchedule, startTime, endTime time.Time, -) { +) error { for i := range h { h[i].BeforeFixedPriceAuctionCreated( ctx, @@ -39,21 +42,22 @@ func (h MultiFundraisingHooks) BeforeFixedPriceAuctionCreated( endTime, ) } + return nil } func (h MultiFundraisingHooks) AfterFixedPriceAuctionCreated( - ctx sdk.Context, + ctx context.Context, auctionId uint64, auctioneer string, - startPrice sdk.Dec, + startPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []VestingSchedule, startTime, endTime time.Time, -) { +) error { for i := range h { - h[i].AfterFixedPriceAuctionCreated( + if err := h[i].AfterFixedPriceAuctionCreated( ctx, auctionId, auctioneer, @@ -63,25 +67,28 @@ func (h MultiFundraisingHooks) AfterFixedPriceAuctionCreated( vestingSchedules, startTime, endTime, - ) + ); err != nil { + return err + } } + return nil } func (h MultiFundraisingHooks) BeforeBatchAuctionCreated( - ctx sdk.Context, + ctx context.Context, auctioneer string, - startPrice sdk.Dec, - minBidPrice sdk.Dec, + startPrice math.LegacyDec, + minBidPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []VestingSchedule, maxExtendedRound uint32, - extendedRoundRate sdk.Dec, + extendedRoundRate math.LegacyDec, startTime time.Time, endTime time.Time, -) { +) error { for i := range h { - h[i].BeforeBatchAuctionCreated( + if err := h[i].BeforeBatchAuctionCreated( ctx, auctioneer, startPrice, @@ -93,26 +100,29 @@ func (h MultiFundraisingHooks) BeforeBatchAuctionCreated( extendedRoundRate, startTime, endTime, - ) + ); err != nil { + return err + } } + return nil } func (h MultiFundraisingHooks) AfterBatchAuctionCreated( - ctx sdk.Context, + ctx context.Context, auctionId uint64, auctioneer string, - startPrice sdk.Dec, - minBidPrice sdk.Dec, + startPrice math.LegacyDec, + minBidPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []VestingSchedule, maxExtendedRound uint32, - extendedRoundRate sdk.Dec, + extendedRoundRate math.LegacyDec, startTime time.Time, endTime time.Time, -) { +) error { for i := range h { - h[i].AfterBatchAuctionCreated( + if err := h[i].AfterBatchAuctionCreated( ctx, auctionId, auctioneer, @@ -125,75 +135,96 @@ func (h MultiFundraisingHooks) AfterBatchAuctionCreated( extendedRoundRate, startTime, endTime, - ) + ); err != nil { + return err + } } + return nil } func (h MultiFundraisingHooks) BeforeAuctionCanceled( - ctx sdk.Context, + ctx context.Context, auctionId uint64, auctioneer string, -) { +) error { for i := range h { - h[i].BeforeAuctionCanceled(ctx, auctionId, auctioneer) + if err := h[i].BeforeAuctionCanceled(ctx, auctionId, auctioneer); err != nil { + return err + } } + return nil } func (h MultiFundraisingHooks) BeforeBidPlaced( - ctx sdk.Context, + ctx context.Context, auctionId uint64, bidId uint64, bidder string, bidType BidType, - price sdk.Dec, + price math.LegacyDec, coin sdk.Coin, -) { +) error { for i := range h { - h[i].BeforeBidPlaced(ctx, auctionId, bidId, bidder, bidType, price, coin) + if err := h[i].BeforeBidPlaced(ctx, auctionId, bidId, bidder, bidType, price, coin); err != nil { + return err + } } + return nil } func (h MultiFundraisingHooks) BeforeBidModified( - ctx sdk.Context, + ctx context.Context, auctionId uint64, bidId uint64, bidder string, bidType BidType, - price sdk.Dec, + price math.LegacyDec, coin sdk.Coin, -) { +) error { for i := range h { - h[i].BeforeBidModified(ctx, auctionId, bidId, bidder, bidType, price, coin) + if err := h[i].BeforeBidModified(ctx, auctionId, bidId, bidder, bidType, price, coin); err != nil { + return err + } } + return nil } func (h MultiFundraisingHooks) BeforeAllowedBiddersAdded( - ctx sdk.Context, + ctx context.Context, allowedBidders []AllowedBidder, -) { +) error { for i := range h { - h[i].BeforeAllowedBiddersAdded(ctx, allowedBidders) + if err := h[i].BeforeAllowedBiddersAdded(ctx, allowedBidders); err != nil { + return err + } } + return nil } func (h MultiFundraisingHooks) BeforeAllowedBidderUpdated( - ctx sdk.Context, + ctx context.Context, auctionId uint64, bidder sdk.AccAddress, maxBidAmount math.Int, -) { +) error { for i := range h { - h[i].BeforeAllowedBidderUpdated(ctx, auctionId, bidder, maxBidAmount) + if err := h[i].BeforeAllowedBidderUpdated(ctx, auctionId, bidder, maxBidAmount); err != nil { + return err + } } + return nil } func (h MultiFundraisingHooks) BeforeSellingCoinsAllocated( - ctx sdk.Context, + ctx context.Context, auctionId uint64, allocationMap map[string]math.Int, refundMap map[string]math.Int, -) { +) error { for i := range h { - h[i].BeforeSellingCoinsAllocated(ctx, auctionId, allocationMap, refundMap) + if err := h[i].BeforeSellingCoinsAllocated(ctx, auctionId, allocationMap, refundMap); err != nil { + return err + } } + return nil } diff --git a/x/fundraising/types/keys.go b/x/fundraising/types/keys.go index 686714de..ffbda7f2 100644 --- a/x/fundraising/types/keys.go +++ b/x/fundraising/types/keys.go @@ -1,12 +1,6 @@ package types -import ( - "bytes" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/address" -) +import "cosmossdk.io/collections" const ( // ModuleName defines the module name @@ -15,101 +9,32 @@ const ( // StoreKey defines the primary module store key StoreKey = ModuleName - // RouterKey is the message route for the fundraising module - RouterKey = ModuleName - - // QuerierRoute defines the module's query routing key - QuerierRoute = ModuleName - // MemStoreKey defines the in-memory store key MemStoreKey = "mem_fundraising" ) -var ( - LastAuctionIdKey = []byte{0x11} // key to retrieve the latest auction id - LastBidIdKeyPrefix = []byte{0x12} - - AuctionKeyPrefix = []byte{0x21} - AllowedBidderKeyPrefix = []byte{0x22} - - BidKeyPrefix = []byte{0x31} - BidIndexKeyPrefix = []byte{0x32} - MatchedBidsLenPrefix = []byte{0x33} - - VestingQueueKeyPrefix = []byte{0x41} -) - -// GetLastBidIdKey returns the store key to retrieve the latest bid id. -func GetLastBidIdKey(auctionId uint64) []byte { - return append(LastBidIdKeyPrefix, sdk.Uint64ToBigEndian(auctionId)...) -} - -// GetAuctionKey returns the store key to retrieve the auction object. -func GetAuctionKey(auctionId uint64) []byte { - return append(AuctionKeyPrefix, sdk.Uint64ToBigEndian(auctionId)...) -} - -// GetAllowedBidderKey returns the store key to retrieve the auction's allowed bidder object. -func GetAllowedBidderKey(auctionId uint64, bidder sdk.AccAddress) []byte { - return append(append(AllowedBidderKeyPrefix, sdk.Uint64ToBigEndian(auctionId)...), address.MustLengthPrefix(bidder)...) -} +var ParamsKey = collections.NewPrefix("p_fundraising") -// GetAllowedBiddersByAuctionKeyPrefix returns the store key prefix to iterate allowed bidders by auction. -func GetAllowedBiddersByAuctionKeyPrefix(auctionId uint64) []byte { - return append(AllowedBidderKeyPrefix, sdk.Uint64ToBigEndian(auctionId)...) +func KeyPrefix(p string) []byte { + return []byte(p) } -// GetBidKey returns the store key to retrieve the bid object. -func GetBidKey(auctionId uint64, bidId uint64) []byte { - return append(append(BidKeyPrefix, sdk.Uint64ToBigEndian(auctionId)...), sdk.Uint64ToBigEndian(bidId)...) -} - -// GetBidByAuctionIdPrefix returns the prefix to iterate all bids by the auction id. -func GetBidByAuctionIdPrefix(auctionId uint64) []byte { - return append(BidKeyPrefix, sdk.Uint64ToBigEndian(auctionId)...) -} - -// GetBidIndexKey returns the index key to retrieve the auction id and bid id to get the bid object. -func GetBidIndexKey(bidder sdk.AccAddress, auctionId uint64, bidId uint64) []byte { - return append(append(append(BidIndexKeyPrefix, address.MustLengthPrefix(bidder)...), sdk.Uint64ToBigEndian(auctionId)...), sdk.Uint64ToBigEndian(bidId)...) -} - -// GetBidByBidderPrefix returns the prefix to iterate all bids by a bidder. -func GetBidIndexByBidderPrefix(bidder sdk.AccAddress) []byte { - return append(BidIndexKeyPrefix, address.MustLengthPrefix(bidder)...) -} - -// GetVestingQueueKey returns the store key to retrieve the vesting queue from the index fields. -func GetVestingQueueKey(auctionId uint64, releaseTime time.Time) []byte { - return append(append(VestingQueueKeyPrefix, sdk.Uint64ToBigEndian(auctionId)...), sdk.FormatTimeBytes(releaseTime)...) -} +var ( + // BidKey is the prefix to retrieve all Bid + BidKey = collections.NewPrefix("bid/value/") + // BidCountKey is the prefix to retrieve all Bid cound + BidCountKey = collections.NewPrefix("bid/count/") -// GetVestingQueueByAuctionIdPrefix returns a key prefix used to iterate vesting queues by an auction id. -func GetVestingQueueByAuctionIdPrefix(auctionId uint64) []byte { - return append(VestingQueueKeyPrefix, sdk.Uint64ToBigEndian(auctionId)...) -} + // AuctionKey is the prefix to retrieve all Auction + AuctionKey = collections.NewPrefix("auction/value/") + // AuctionCountKey is the prefix to retrieve all Auction count + AuctionCountKey = collections.NewPrefix("auction/count/") -func GetLastMatchedBidsLenKey(auctionId uint64) []byte { - return append(MatchedBidsLenPrefix, sdk.Uint64ToBigEndian(auctionId)...) -} + // AllowedBidderKey is the prefix to retrieve all AllowedBidder + AllowedBidderKey = collections.NewPrefix("AllowedBidder/value/") -// ParseBidIndexKey parses bid index key. -func ParseBidIndexKey(key []byte) (auctionId, bidId uint64) { - if !bytes.HasPrefix(key, BidIndexKeyPrefix) { - panic("key does not have proper prefix") - } + // VestingQueueKey is the prefix to retrieve all VestingQueue + VestingQueueKey = collections.NewPrefix("VestingQueue/value/") - addrLen := key[1] - bytesLen := 8 - auctionId = sdk.BigEndianToUint64(key[2+addrLen:]) - bidId = sdk.BigEndianToUint64(key[2+addrLen+byte(bytesLen):]) - return -} - -// SplitAuctionIdBidIdKey splits the auction id and bid id. -func SplitAuctionIdBidIdKey(key []byte) (auctionId, bidId uint64) { - bytesLen := 8 - auctionId = sdk.BigEndianToUint64(key) - bidId = sdk.BigEndianToUint64(key[byte(bytesLen):]) - return -} + MatchedBidsLenKey = collections.NewPrefix("MatchedBidsLen/value/") +) diff --git a/x/fundraising/types/keys_test.go b/x/fundraising/types/keys_test.go deleted file mode 100644 index a3240263..00000000 --- a/x/fundraising/types/keys_test.go +++ /dev/null @@ -1,210 +0,0 @@ -package types_test - -import ( - "testing" - "time" - - "github.com/cometbft/cometbft/crypto" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/suite" - - "github.com/tendermint/fundraising/x/fundraising/types" -) - -type keysTestSuite struct { - suite.Suite -} - -func TestKeysTestSuite(t *testing.T) { - suite.Run(t, new(keysTestSuite)) -} - -func (s *keysTestSuite) TestGetLastBidIdKey() { - s.Require().Equal([]byte{0x12, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, types.GetLastBidIdKey(0)) - s.Require().Equal([]byte{0x12, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9}, types.GetLastBidIdKey(9)) - s.Require().Equal([]byte{0x12, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa}, types.GetLastBidIdKey(10)) -} - -func (s *keysTestSuite) TestGetAuctionKey() { - s.Require().Equal([]byte{0x21, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, types.GetAuctionKey(0)) - s.Require().Equal([]byte{0x21, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9}, types.GetAuctionKey(9)) - s.Require().Equal([]byte{0x21, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa}, types.GetAuctionKey(10)) -} - -func (s *keysTestSuite) TestGetAllowedBiddersByAuctionKeyPrefix() { - s.Require().Equal([]byte{0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, types.GetAllowedBiddersByAuctionKeyPrefix(0)) - s.Require().Equal([]byte{0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9}, types.GetAllowedBiddersByAuctionKeyPrefix(9)) - s.Require().Equal([]byte{0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa}, types.GetAllowedBiddersByAuctionKeyPrefix(10)) -} - -func (s *keysTestSuite) TestGetBidByAuctionIdPrefix() { - s.Require().Equal([]byte{0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, types.GetBidByAuctionIdPrefix(0)) - s.Require().Equal([]byte{0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9}, types.GetBidByAuctionIdPrefix(9)) - s.Require().Equal([]byte{0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa}, types.GetBidByAuctionIdPrefix(10)) -} - -func (s *keysTestSuite) TestGetLastMatchedBidsLenKey() { - s.Require().Equal([]byte{0x33, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, types.GetLastMatchedBidsLenKey(0)) - s.Require().Equal([]byte{0x33, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9}, types.GetLastMatchedBidsLenKey(9)) - s.Require().Equal([]byte{0x33, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa}, types.GetLastMatchedBidsLenKey(10)) -} - -func (s *keysTestSuite) TestGetBidIndexByBidderPrefix() { - bidder1 := sdk.AccAddress(crypto.AddressHash([]byte("bidder1"))) - bidder2 := sdk.AccAddress(crypto.AddressHash([]byte("bidder2"))) - bidder3 := sdk.AccAddress(crypto.AddressHash([]byte("bidder3"))) - s.Require().Equal([]byte{0x32, 0x14, 0x20, 0x5c, 0xa, 0x82, 0xa, 0xf1, 0xed, - 0x98, 0x39, 0x6a, 0x35, 0xfe, 0xe3, 0x5d, 0x5, 0x2c, 0xd7, 0x96, 0x5a, 0x37}, types.GetBidIndexByBidderPrefix(bidder1)) - s.Require().Equal([]byte{0x32, 0x14, 0xa, 0xaf, 0x72, 0x3a, 0xd0, 0x8c, 0x17, - 0x88, 0x2e, 0xf6, 0x7a, 0x5, 0x31, 0xb3, 0x46, 0xdd, 0x22, 0xb3, 0x62, 0x1e}, types.GetBidIndexByBidderPrefix(bidder2)) - s.Require().Equal([]byte{0x32, 0x14, 0xe, 0x99, 0x7b, 0x9b, 0x5c, 0xef, 0x81, - 0x2f, 0xc6, 0x3f, 0xb6, 0x8b, 0x27, 0x42, 0x8a, 0xab, 0x7a, 0x58, 0xbc, 0x5e}, types.GetBidIndexByBidderPrefix(bidder3)) -} - -func (s *keysTestSuite) TestGetVestingQueueByAuctionIdPrefix() { - s.Require().Equal([]byte{0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, types.GetVestingQueueByAuctionIdPrefix(0)) - s.Require().Equal([]byte{0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9}, types.GetVestingQueueByAuctionIdPrefix(9)) - s.Require().Equal([]byte{0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa}, types.GetVestingQueueByAuctionIdPrefix(10)) -} - -func (s *keysTestSuite) TestGetAllowedBidderKey() { - testCases := []struct { - auctionId uint64 - bidderAddr sdk.AccAddress - expected []byte - }{ - { - uint64(1), - sdk.AccAddress(crypto.AddressHash([]byte("bidder1"))), - []byte{0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x14, 0x20, 0x5c, 0xa, 0x82, - 0xa, 0xf1, 0xed, 0x98, 0x39, 0x6a, 0x35, 0xfe, 0xe3, 0x5d, 0x5, 0x2c, 0xd7, 0x96, 0x5a, 0x37}, - }, - { - uint64(3), - sdk.AccAddress(crypto.AddressHash([]byte("bidder2"))), - []byte{0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x14, 0xa, 0xaf, 0x72, 0x3a, - 0xd0, 0x8c, 0x17, 0x88, 0x2e, 0xf6, 0x7a, 0x5, 0x31, 0xb3, 0x46, 0xdd, 0x22, 0xb3, 0x62, 0x1e}, - }, - { - uint64(11), - sdk.AccAddress(crypto.AddressHash([]byte("bidder3"))), - []byte{0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xb, 0x14, 0xe, 0x99, 0x7b, 0x9b, 0x5c, 0xef, 0x81, - 0x2f, 0xc6, 0x3f, 0xb6, 0x8b, 0x27, 0x42, 0x8a, 0xab, 0x7a, 0x58, 0xbc, 0x5e}, - }, - } - - for _, tc := range testCases { - key := types.GetAllowedBidderKey(tc.auctionId, tc.bidderAddr) - s.Require().Equal(tc.expected, key) - } -} - -func (s *keysTestSuite) TestGetBidKey() { - testCases := []struct { - auctionId uint64 - bidId uint64 - expected []byte - }{ - { - uint64(5), - uint64(10), - []byte{0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa}, - }, - { - uint64(2), - uint64(7), - []byte{0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7}, - }, - { - uint64(3), - uint64(5), - []byte{0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5}, - }, - } - - for _, tc := range testCases { - key := types.GetBidKey(tc.auctionId, tc.bidId) - s.Require().Equal(tc.expected, key) - } -} - -func (s *keysTestSuite) TestBidIndexKey() { - testCases := []struct { - bidderAddr sdk.AccAddress - auctionId uint64 - bidId uint64 - expected []byte - }{ - { - sdk.AccAddress(crypto.AddressHash([]byte("bidder1"))), - uint64(1), - uint64(1), - []byte{0x32, 0x14, 0x20, 0x5c, 0xa, 0x82, 0xa, 0xf1, 0xed, - 0x98, 0x39, 0x6a, 0x35, 0xfe, 0xe3, 0x5d, 0x5, 0x2c, 0xd7, - 0x96, 0x5a, 0x37, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1}, - }, - { - sdk.AccAddress(crypto.AddressHash([]byte("bidder2"))), - uint64(3), - uint64(12), - []byte{0x32, 0x14, 0xa, 0xaf, 0x72, 0x3a, 0xd0, 0x8c, 0x17, - 0x88, 0x2e, 0xf6, 0x7a, 0x5, 0x31, 0xb3, 0x46, 0xdd, 0x22, - 0xb3, 0x62, 0x1e, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc}, - }, - { - sdk.AccAddress(crypto.AddressHash([]byte("bidder3"))), - uint64(12), - uint64(2), - []byte{0x32, 0x14, 0xe, 0x99, 0x7b, 0x9b, 0x5c, 0xef, 0x81, - 0x2f, 0xc6, 0x3f, 0xb6, 0x8b, 0x27, 0x42, 0x8a, 0xab, 0x7a, - 0x58, 0xbc, 0x5e, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2}, - }, - } - - for _, tc := range testCases { - key := types.GetBidIndexKey(tc.bidderAddr, tc.auctionId, tc.bidId) - s.Require().Equal(tc.expected, key) - - auctionId, bidId := types.ParseBidIndexKey(key) - s.Require().Equal(tc.auctionId, auctionId) - s.Require().Equal(tc.bidId, bidId) - } -} - -func (s *keysTestSuite) TestVestingQueueKey() { - testCases := []struct { - auctionId uint64 - timestamp time.Time - expected []byte - }{ - { - uint64(1), - types.MustParseRFC3339("2021-12-01T00:00:00Z"), - []byte{0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x32, 0x30, 0x32, 0x31, - 0x2d, 0x31, 0x32, 0x2d, 0x30, 0x31, 0x54, 0x30, 0x30, 0x3a, 0x30, 0x30, - 0x3a, 0x30, 0x30, 0x2e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30}, - }, - { - uint64(5), - types.MustParseRFC3339("2022-01-05T00:00:00Z"), - []byte{0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0x32, 0x30, 0x32, 0x32, - 0x2d, 0x30, 0x31, 0x2d, 0x30, 0x35, 0x54, 0x30, 0x30, 0x3a, 0x30, 0x30, - 0x3a, 0x30, 0x30, 0x2e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30}, - }, - { - uint64(11), - types.MustParseRFC3339("2022-07-11T00:00:00Z"), - []byte{0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xb, 0x32, 0x30, 0x32, 0x32, 0x2d, - 0x30, 0x37, 0x2d, 0x31, 0x31, 0x54, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x3a, 0x30, - 0x30, 0x2e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30}, - }, - } - - for _, tc := range testCases { - key := types.GetVestingQueueKey(tc.auctionId, tc.timestamp) - s.Require().Equal(tc.expected, key) - } -} diff --git a/x/fundraising/types/match.go b/x/fundraising/types/match.go index 0d12058d..9228af52 100644 --- a/x/fundraising/types/match.go +++ b/x/fundraising/types/match.go @@ -2,11 +2,10 @@ package types import ( "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" ) type MatchResult struct { - MatchPrice sdk.Dec + MatchPrice math.LegacyDec MatchedAmount math.Int MatchedBids []Bid MatchResultByBidder map[string]*BidderMatchResult @@ -18,10 +17,10 @@ type BidderMatchResult struct { } // Match returns the match result for all bids that correspond with the auction. -func Match(matchPrice sdk.Dec, prices []sdk.Dec, bidsByPrice map[string][]Bid, sellingAmt math.Int, allowedBidders []AllowedBidder) (res *MatchResult, matched bool) { +func Match(matchPrice math.LegacyDec, prices []math.LegacyDec, bidsByPrice map[string][]Bid, sellingAmt math.Int, allowedBidders []AllowedBidder) (res *MatchResult, matched bool) { res = &MatchResult{ MatchPrice: matchPrice, - MatchedAmount: sdk.ZeroInt(), + MatchedAmount: math.ZeroInt(), MatchResultByBidder: map[string]*BidderMatchResult{}, } @@ -39,12 +38,12 @@ func Match(matchPrice sdk.Dec, prices []sdk.Dec, bidsByPrice map[string][]Bid, s var bidAmt math.Int switch bid.Type { case BidTypeBatchWorth: - bidAmt = sdk.NewDecFromInt(bid.Coin.Amount).QuoTruncate(matchPrice).TruncateInt() + bidAmt = math.LegacyNewDecFromInt(bid.Coin.Amount).QuoTruncate(matchPrice).TruncateInt() case BidTypeBatchMany: bidAmt = bid.Coin.Amount } biddableAmt := biddableAmtByBidder[bid.Bidder] - matchAmt := sdk.MinInt(bidAmt, biddableAmtByBidder[bid.Bidder]) + matchAmt := math.MinInt(bidAmt, biddableAmtByBidder[bid.Bidder]) if res.MatchedAmount.Add(matchAmt).GT(sellingAmt) { // Including this bid will exceed the auction's selling amount. @@ -56,8 +55,8 @@ func Match(matchPrice sdk.Dec, prices []sdk.Dec, bidsByPrice map[string][]Bid, s bidderRes, ok := res.MatchResultByBidder[bid.Bidder] if !ok { bidderRes = &BidderMatchResult{ - PayingAmount: sdk.ZeroInt(), - MatchedAmount: sdk.ZeroInt(), + PayingAmount: math.ZeroInt(), + MatchedAmount: math.ZeroInt(), } res.MatchResultByBidder[bid.Bidder] = bidderRes } diff --git a/x/fundraising/types/match_test.go b/x/fundraising/types/match_test.go index a0f51186..936ecda3 100644 --- a/x/fundraising/types/match_test.go +++ b/x/fundraising/types/match_test.go @@ -20,9 +20,9 @@ func testAddr(addrNum int) sdk.AccAddress { return addr } -// parseDec parses string and returns sdk.Dec. -func parseDec(s string) sdk.Dec { - return sdk.MustNewDecFromStr(s) +// parseDec parses string and returns math.LegacyDec. +func parseDec(s string) math.LegacyDec { + return math.LegacyMustNewDecFromStr(s) } func TestMatch(t *testing.T) { @@ -31,7 +31,7 @@ func TestMatch(t *testing.T) { sellingCoinDenom = "selling" ) - newBid := func(id uint64, typ types.BidType, bidder string, price sdk.Dec, bidAmt math.Int) types.Bid { + newBid := func(id uint64, typ types.BidType, bidder string, price math.LegacyDec, bidAmt math.Int) types.Bid { var coin sdk.Coin switch typ { case types.BidTypeBatchWorth: @@ -60,7 +60,7 @@ func TestMatch(t *testing.T) { allowedBidders map[string]math.Int sellingCoinAmt math.Int bids []types.Bid - matchPrice sdk.Dec + matchPrice math.LegacyDec matched bool matchedAmt math.Int matchedBidIds []uint64 // should be sorted @@ -69,54 +69,56 @@ func TestMatch(t *testing.T) { { "basic case", map[string]math.Int{ - bidders[0]: sdk.NewInt(100_000000), + bidders[0]: math.NewInt(100_000000), }, - sdk.NewInt(100_000000), + math.NewInt(100_000000), []types.Bid{ - newBid(1, types.BidTypeBatchWorth, bidders[0], parseDec("1.0"), sdk.NewInt(100_000000)), + newBid(1, types.BidTypeBatchWorth, bidders[0], parseDec("1.0"), math.NewInt(100_000000)), }, parseDec("1.0"), true, - sdk.NewInt(100_000000), + math.NewInt(100_000000), []uint64{1}, map[string]*types.BidderMatchResult{ bidders[0]: { - PayingAmount: sdk.NewInt(100_000000), - MatchedAmount: sdk.NewInt(100_000000), + PayingAmount: math.NewInt(100_000000), + MatchedAmount: math.NewInt(100_000000), }, }, }, { "partial match", map[string]math.Int{ - bidders[0]: sdk.NewInt(50_000000), + bidders[0]: math.NewInt(50_000000), }, - sdk.NewInt(100_000000), + math.NewInt(100_000000), []types.Bid{ - newBid(1, types.BidTypeBatchWorth, bidders[0], parseDec("1.0"), sdk.NewInt(100_000000)), + newBid(1, types.BidTypeBatchWorth, bidders[0], parseDec("1.0"), math.NewInt(100_000000)), }, parseDec("1.0"), true, - sdk.NewInt(50_000000), + math.NewInt(50_000000), []uint64{1}, map[string]*types.BidderMatchResult{ bidders[0]: { - PayingAmount: sdk.NewInt(50_000000), - MatchedAmount: sdk.NewInt(50_000000), + PayingAmount: math.NewInt(50_000000), + MatchedAmount: math.NewInt(50_000000), }, }, }, { "no match", map[string]math.Int{ - bidders[0]: sdk.NewInt(100_000000), + bidders[0]: math.NewInt(100_000000), }, - sdk.NewInt(100_000000), + math.NewInt(100_000000), []types.Bid{ - newBid(1, types.BidTypeBatchWorth, bidders[0], parseDec("1.0"), sdk.NewInt(100_000000)), + newBid(1, types.BidTypeBatchWorth, bidders[0], parseDec("1.0"), math.NewInt(100_000000)), }, parseDec("1.1"), - false, math.Int{}, nil, nil, + false, + math.Int{}, + nil, nil, }, } { t.Run(tc.name, func(t *testing.T) { diff --git a/x/fundraising/types/msgs.go b/x/fundraising/types/msgs.go index 002ce2a6..5675d5e6 100644 --- a/x/fundraising/types/msgs.go +++ b/x/fundraising/types/msgs.go @@ -3,113 +3,39 @@ package types import ( "time" - "github.com/cosmos/cosmos-sdk/codec/legacy" + sdkerrors "cosmossdk.io/errors" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/errors" ) -var ( - _ sdk.Msg = (*MsgCreateFixedPriceAuction)(nil) - _ sdk.Msg = (*MsgCreateBatchAuction)(nil) - _ sdk.Msg = (*MsgCancelAuction)(nil) - _ sdk.Msg = (*MsgPlaceBid)(nil) - _ sdk.Msg = (*MsgModifyBid)(nil) - _ sdk.Msg = (*MsgAddAllowedBidder)(nil) -) - -// Message types for the fundraising module. -const ( - TypeMsgCreateFixedPriceAuction = "create_fixed_price_auction" - TypeMsgCreateBatchAuction = "create_batch_auction" - TypeMsgCancelAuction = "cancel_auction" - TypeMsgPlaceBid = "place_bid" - TypeMsgModifyBid = "modify_bid" - TypeMsgAddAllowedBidder = "add_allowed_bidder" -) - -// NewMsgCreateFixedPriceAuction creates a new MsgCreateFixedPriceAuction. -func NewMsgCreateFixedPriceAuction( - auctioneer string, - startPrice sdk.Dec, - sellingCoin sdk.Coin, - payingCoinDenom string, - vestingSchedules []VestingSchedule, - startTime time.Time, - endTime time.Time, -) *MsgCreateFixedPriceAuction { - return &MsgCreateFixedPriceAuction{ - Auctioneer: auctioneer, - StartPrice: startPrice, - SellingCoin: sellingCoin, - PayingCoinDenom: payingCoinDenom, - VestingSchedules: vestingSchedules, - StartTime: startTime, - EndTime: endTime, +func NewMsgCancelAuction(auctioneer string, auctionId uint64) *MsgCancelAuction { + return &MsgCancelAuction{ + Auctioneer: auctioneer, + AuctionId: auctionId, } } -func (msg MsgCreateFixedPriceAuction) Route() string { return RouterKey } - -func (msg MsgCreateFixedPriceAuction) Type() string { return TypeMsgCreateFixedPriceAuction } +func (msg MsgCancelAuction) Type() string { + return sdk.MsgTypeURL(&MsgCancelAuction{}) +} -func (msg MsgCreateFixedPriceAuction) ValidateBasic() error { +func (msg MsgCancelAuction) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Auctioneer); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid auctioneer address: %v", err) - } - if !msg.StartPrice.IsPositive() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "start price must be positive") - } - if err := msg.SellingCoin.Validate(); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid selling coin: %v", err) - } - if !msg.SellingCoin.Amount.IsPositive() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "selling coin amount must be positive") - } - if msg.SellingCoin.Denom == msg.PayingCoinDenom { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "selling coin denom must not be the same as paying coin denom") - } - if err := sdk.ValidateDenom(msg.PayingCoinDenom); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid paying coin denom: %v", err) - } - if !msg.EndTime.After(msg.StartTime) { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "end time must be set after start time") - } - if err := ValidateVestingSchedules(msg.VestingSchedules, msg.EndTime); err != nil { - return err + return sdkerrors.Wrapf(errors.ErrInvalidAddress, "invalid auctioneer address: %v", err) } return nil } -func (msg MsgCreateFixedPriceAuction) GetSignBytes() []byte { - return sdk.MustSortJSON(legacy.Cdc.MustMarshalJSON(&msg)) -} - -func (msg MsgCreateFixedPriceAuction) GetSigners() []sdk.AccAddress { - addr, err := sdk.AccAddressFromBech32(msg.Auctioneer) - if err != nil { - panic(err) - } - return []sdk.AccAddress{addr} -} - -func (msg MsgCreateFixedPriceAuction) GetAuctioneer() sdk.AccAddress { - addr, err := sdk.AccAddressFromBech32(msg.Auctioneer) - if err != nil { - panic(err) - } - return addr -} - -// NewMsgCreateBatchAuction creates a new MsgCreateBatchAuction. func NewMsgCreateBatchAuction( auctioneer string, - startPrice sdk.Dec, - minBidPrice sdk.Dec, + startPrice math.LegacyDec, + minBidPrice math.LegacyDec, sellingCoin sdk.Coin, payingCoinDenom string, vestingSchedules []VestingSchedule, maxExtendedRound uint32, - extendedRoundRate sdk.Dec, + extendedRoundRate math.LegacyDec, startTime time.Time, endTime time.Time, ) *MsgCreateBatchAuction { @@ -127,254 +53,183 @@ func NewMsgCreateBatchAuction( } } -func (msg MsgCreateBatchAuction) Route() string { return RouterKey } - -func (msg MsgCreateBatchAuction) Type() string { return TypeMsgCreateBatchAuction } +func (msg MsgCreateBatchAuction) Type() string { + return sdk.MsgTypeURL(&MsgCreateBatchAuction{}) +} func (msg MsgCreateBatchAuction) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Auctioneer); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid auctioneer address: %v", err) + return sdkerrors.Wrapf(errors.ErrInvalidAddress, "invalid auctioneer address: %v", err) } if !msg.StartPrice.IsPositive() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "start price must be positive") + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "start price must be positive") } if !msg.MinBidPrice.IsPositive() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "minimum price must be positive") + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "minimum price must be positive") } if err := msg.SellingCoin.Validate(); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid selling coin: %v", err) + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "invalid selling coin: %v", err) } if !msg.SellingCoin.Amount.IsPositive() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "selling coin amount must be positive") + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "selling coin amount must be positive") } if msg.SellingCoin.Denom == msg.PayingCoinDenom { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "selling coin denom must not be the same as paying coin denom") + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "selling coin denom must not be the same as paying coin denom") } if err := sdk.ValidateDenom(msg.PayingCoinDenom); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid paying coin denom: %v", err) + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "invalid paying coin denom: %v", err) } if !msg.EndTime.After(msg.StartTime) { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "end time must be set after start time") - } - if err := ValidateVestingSchedules(msg.VestingSchedules, msg.EndTime); err != nil { - return err + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "end time must be set after start time") } if !msg.ExtendedRoundRate.IsPositive() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "extend rate must be positive") - } - return nil -} - -func (msg MsgCreateBatchAuction) GetSignBytes() []byte { - return sdk.MustSortJSON(legacy.Cdc.MustMarshalJSON(&msg)) -} - -func (msg MsgCreateBatchAuction) GetSigners() []sdk.AccAddress { - addr, err := sdk.AccAddressFromBech32(msg.Auctioneer) - if err != nil { - panic(err) - } - return []sdk.AccAddress{addr} -} - -func (msg MsgCreateBatchAuction) GetAuctioneer() sdk.AccAddress { - addr, err := sdk.AccAddressFromBech32(msg.Auctioneer) - if err != nil { - panic(err) + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "extend rate must be positive") } - return addr + return ValidateVestingSchedules(msg.VestingSchedules, msg.EndTime) } -// NewMsgCancelAuction creates a new MsgCancelAuction. -func NewMsgCancelAuction( +func NewMsgCreateFixedPriceAuction( auctioneer string, - auctionId uint64, -) *MsgCancelAuction { - return &MsgCancelAuction{ - Auctioneer: auctioneer, - AuctionId: auctionId, + startPrice math.LegacyDec, + sellingCoin sdk.Coin, + payingCoinDenom string, + vestingSchedules []VestingSchedule, + startTime time.Time, + endTime time.Time, +) *MsgCreateFixedPriceAuction { + return &MsgCreateFixedPriceAuction{ + Auctioneer: auctioneer, + StartPrice: startPrice, + SellingCoin: sellingCoin, + PayingCoinDenom: payingCoinDenom, + VestingSchedules: vestingSchedules, + StartTime: startTime, + EndTime: endTime, } } -func (msg MsgCancelAuction) Route() string { return RouterKey } - -func (msg MsgCancelAuction) Type() string { return TypeMsgCancelAuction } +func (msg MsgCreateFixedPriceAuction) Type() string { + return sdk.MsgTypeURL(&MsgCreateFixedPriceAuction{}) +} -func (msg MsgCancelAuction) ValidateBasic() error { +func (msg MsgCreateFixedPriceAuction) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Auctioneer); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid auctioneer address: %v", err) + return sdkerrors.Wrapf(errors.ErrInvalidAddress, "invalid auctioneer address: %v", err) } - return nil -} - -func (msg MsgCancelAuction) GetSignBytes() []byte { - return sdk.MustSortJSON(legacy.Cdc.MustMarshalJSON(&msg)) -} - -func (msg MsgCancelAuction) GetSigners() []sdk.AccAddress { - addr, err := sdk.AccAddressFromBech32(msg.Auctioneer) - if err != nil { - panic(err) + if !msg.StartPrice.IsPositive() { + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "start price must be positive") } - return []sdk.AccAddress{addr} -} - -func (msg MsgCancelAuction) GetAuctioneer() sdk.AccAddress { - addr, err := sdk.AccAddressFromBech32(msg.Auctioneer) - if err != nil { - panic(err) + if err := msg.SellingCoin.Validate(); err != nil { + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "invalid selling coin: %v", err) } - return addr + if !msg.SellingCoin.Amount.IsPositive() { + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "selling coin amount must be positive") + } + if msg.SellingCoin.Denom == msg.PayingCoinDenom { + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "selling coin denom must not be the same as paying coin denom") + } + if err := sdk.ValidateDenom(msg.PayingCoinDenom); err != nil { + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "invalid paying coin denom: %v", err) + } + if !msg.EndTime.After(msg.StartTime) { + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "end time must be set after start time") + } + return ValidateVestingSchedules(msg.VestingSchedules, msg.EndTime) } -// NewMsgPlaceBid creates a new MsgPlaceBid. func NewMsgPlaceBid( auctionId uint64, bidder string, bidType BidType, - Price sdk.Dec, - Coin sdk.Coin, + price math.LegacyDec, + coin sdk.Coin, ) *MsgPlaceBid { return &MsgPlaceBid{ - AuctionId: auctionId, Bidder: bidder, + AuctionId: auctionId, BidType: bidType, - Price: Price, - Coin: Coin, + Price: price, + Coin: coin, } } -func (msg MsgPlaceBid) Route() string { return RouterKey } - -func (msg MsgPlaceBid) Type() string { return TypeMsgPlaceBid } +func (msg MsgPlaceBid) Type() string { + return sdk.MsgTypeURL(&MsgPlaceBid{}) +} func (msg MsgPlaceBid) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Bidder); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid bidder address: %v", err) + return sdkerrors.Wrapf(errors.ErrInvalidAddress, "invalid bidder address: %v", err) } if !msg.Price.IsPositive() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "bid price must be positive value") + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "bid price must be positive value") } if err := msg.Coin.Validate(); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid bid coin: %v", err) + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "invalid bid coin: %v", err) } if !msg.Coin.Amount.IsPositive() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid coin amount: %s", msg.Coin.Amount.String()) + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "invalid coin amount: %s", msg.Coin.Amount.String()) } if msg.BidType != BidTypeFixedPrice && msg.BidType != BidTypeBatchWorth && msg.BidType != BidTypeBatchMany { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid bid type: %T", msg.BidType.String()) + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "invalid bid type: %T", msg.BidType.String()) } return nil } -func (msg MsgPlaceBid) GetSignBytes() []byte { - return sdk.MustSortJSON(legacy.Cdc.MustMarshalJSON(&msg)) +func NewMsgAddAllowedBidder( + auctionId uint64, + allowedBidder AllowedBidder, +) *MsgAddAllowedBidder { + return &MsgAddAllowedBidder{ + AuctionId: auctionId, + AllowedBidder: allowedBidder, + } } -func (msg MsgPlaceBid) GetSigners() []sdk.AccAddress { - addr, err := sdk.AccAddressFromBech32(msg.Bidder) - if err != nil { - panic(err) - } - return []sdk.AccAddress{addr} +func (msg MsgAddAllowedBidder) Type() string { + return sdk.MsgTypeURL(&MsgAddAllowedBidder{}) } -func (msg MsgPlaceBid) GetBidder() sdk.AccAddress { - addr, err := sdk.AccAddressFromBech32(msg.Bidder) - if err != nil { - panic(err) +func (msg MsgAddAllowedBidder) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.AllowedBidder.Bidder); err != nil { + return sdkerrors.Wrapf(errors.ErrInvalidAddress, "invalid bidder address: %v", err) } - return addr + return nil } -// NewMsgModifyBid creates a new MsgModifyBid. func NewMsgModifyBid( auctionId uint64, bidder string, bidId uint64, - price sdk.Dec, + price math.LegacyDec, coin sdk.Coin, ) *MsgModifyBid { return &MsgModifyBid{ - AuctionId: auctionId, Bidder: bidder, + AuctionId: auctionId, BidId: bidId, Price: price, Coin: coin, } } -func (msg MsgModifyBid) Route() string { return RouterKey } - -func (msg MsgModifyBid) Type() string { return TypeMsgModifyBid } +func (msg MsgModifyBid) Type() string { + return sdk.MsgTypeURL(&MsgModifyBid{}) +} func (msg MsgModifyBid) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Bidder); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid bidder address: %v", err) + return sdkerrors.Wrapf(errors.ErrInvalidAddress, "invalid bidder address: %v", err) } if !msg.Price.IsPositive() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "bid price must be positive value") + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "bid price must be positive value") } if err := msg.Coin.Validate(); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid bid coin: %v", err) + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "invalid bid coin: %v", err) } if !msg.Coin.Amount.IsPositive() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid coin amount: %s", msg.Coin.Amount.String()) - } - return nil -} - -func (msg MsgModifyBid) GetSignBytes() []byte { - return sdk.MustSortJSON(legacy.Cdc.MustMarshalJSON(&msg)) -} - -func (msg MsgModifyBid) GetSigners() []sdk.AccAddress { - addr, err := sdk.AccAddressFromBech32(msg.Bidder) - if err != nil { - panic(err) - } - return []sdk.AccAddress{addr} -} - -func (msg MsgModifyBid) GetBidder() sdk.AccAddress { - addr, err := sdk.AccAddressFromBech32(msg.Bidder) - if err != nil { - panic(err) - } - return addr -} - -// NewMsgAddAllowedBidder creates a new MsgAddAllowedBidder. -func NewMsgAddAllowedBidder( - auctionId uint64, - allowedBidder AllowedBidder, -) *MsgAddAllowedBidder { - return &MsgAddAllowedBidder{ - AuctionId: auctionId, - AllowedBidder: allowedBidder, - } -} - -func (msg MsgAddAllowedBidder) Route() string { return RouterKey } - -func (msg MsgAddAllowedBidder) Type() string { return TypeMsgAddAllowedBidder } - -func (msg MsgAddAllowedBidder) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(msg.AllowedBidder.Bidder); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid bidder address: %v", err) + return sdkerrors.Wrapf(errors.ErrInvalidRequest, "invalid coin amount: %s", msg.Coin.Amount.String()) } return nil } - -func (msg MsgAddAllowedBidder) GetSignBytes() []byte { - return sdk.MustSortJSON(legacy.Cdc.MustMarshalJSON(&msg)) -} - -func (msg MsgAddAllowedBidder) GetSigners() []sdk.AccAddress { - addr, err := sdk.AccAddressFromBech32(msg.AllowedBidder.Bidder) - if err != nil { - panic(err) - } - return []sdk.AccAddress{addr} -} diff --git a/x/fundraising/types/msgs_test.go b/x/fundraising/types/msgs_test.go index fd1011af..a70aa3c5 100644 --- a/x/fundraising/types/msgs_test.go +++ b/x/fundraising/types/msgs_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" + "cosmossdk.io/math" "github.com/cometbft/cometbft/crypto" - "github.com/cosmos/cosmos-sdk/codec/legacy" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -21,7 +21,7 @@ func TestMsgCreateFixedPriceAuction(t *testing.T) { "", // empty means no error expected types.NewMsgCreateFixedPriceAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{}, @@ -33,7 +33,7 @@ func TestMsgCreateFixedPriceAuction(t *testing.T) { "start price must be positive: invalid request", types.NewMsgCreateFixedPriceAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0"), + math.LegacyMustNewDecFromStr("0"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{}, @@ -45,7 +45,7 @@ func TestMsgCreateFixedPriceAuction(t *testing.T) { "selling coin amount must be positive: invalid request", types.NewMsgCreateFixedPriceAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), sdk.NewInt64Coin("denom2", 0), "denom1", []types.VestingSchedule{}, @@ -57,7 +57,7 @@ func TestMsgCreateFixedPriceAuction(t *testing.T) { "selling coin denom must not be the same as paying coin denom: invalid request", types.NewMsgCreateFixedPriceAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom2", []types.VestingSchedule{}, @@ -69,7 +69,7 @@ func TestMsgCreateFixedPriceAuction(t *testing.T) { "end time must be set after start time: invalid request", types.NewMsgCreateFixedPriceAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{}, @@ -81,13 +81,13 @@ func TestMsgCreateFixedPriceAuction(t *testing.T) { "vesting weight must be positive: invalid vesting schedules", types.NewMsgCreateFixedPriceAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{ { time.Now().AddDate(0, 1, 0).AddDate(0, 6, 0), - sdk.ZeroDec(), + math.LegacyZeroDec(), }, }, time.Now(), @@ -98,13 +98,13 @@ func TestMsgCreateFixedPriceAuction(t *testing.T) { "vesting weight must not be greater than 1: invalid vesting schedules", types.NewMsgCreateFixedPriceAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{ { time.Now().AddDate(0, 1, 0).AddDate(0, 6, 0), - sdk.MustNewDecFromStr("1.1"), + math.LegacyMustNewDecFromStr("1.1"), }, }, time.Now(), @@ -115,13 +115,13 @@ func TestMsgCreateFixedPriceAuction(t *testing.T) { "release time must be set after the end time: invalid vesting schedules", types.NewMsgCreateFixedPriceAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{ { types.MustParseRFC3339("2022-06-01T22:08:41+00:00"), - sdk.MustNewDecFromStr("1.0"), + math.LegacyMustNewDecFromStr("1.0"), }, }, time.Now(), @@ -132,17 +132,17 @@ func TestMsgCreateFixedPriceAuction(t *testing.T) { "release time must be chronological: invalid vesting schedules", types.NewMsgCreateFixedPriceAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{ { time.Now().AddDate(0, 1, 0).AddDate(0, 6, 0), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), }, { time.Now().AddDate(0, 1, 0).AddDate(0, 3, 0), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), }, }, time.Now(), @@ -153,17 +153,17 @@ func TestMsgCreateFixedPriceAuction(t *testing.T) { "total vesting weight must be equal to 1: invalid vesting schedules", types.NewMsgCreateFixedPriceAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{ { time.Now().AddDate(0, 1, 0).AddDate(0, 6, 0), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), }, { time.Now().AddDate(0, 1, 0).AddDate(1, 0, 0), - sdk.MustNewDecFromStr("0.3"), + math.LegacyMustNewDecFromStr("0.3"), }, }, time.Now(), @@ -174,7 +174,7 @@ func TestMsgCreateFixedPriceAuction(t *testing.T) { "invalid auctioneer address: empty address string is not allowed: invalid address", types.NewMsgCreateFixedPriceAuction( "", - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{}, @@ -186,16 +186,10 @@ func TestMsgCreateFixedPriceAuction(t *testing.T) { for _, tc := range testCases { require.IsType(t, &types.MsgCreateFixedPriceAuction{}, tc.msg) - require.Equal(t, types.TypeMsgCreateFixedPriceAuction, tc.msg.Type()) - require.Equal(t, types.RouterKey, tc.msg.Route()) - require.Equal(t, sdk.MustSortJSON(legacy.Cdc.MustMarshalJSON(tc.msg)), tc.msg.GetSignBytes()) err := tc.msg.ValidateBasic() if tc.expectedErr == "" { require.Nil(t, err) - signers := tc.msg.GetSigners() - require.Len(t, signers, 1) - require.Equal(t, tc.msg.GetAuctioneer(), signers[0]) } else { require.EqualError(t, err, tc.expectedErr) } @@ -211,13 +205,13 @@ func TestMsgCreateBatchAuction(t *testing.T) { "", // empty means no error expected types.NewMsgCreateBatchAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), - sdk.MustNewDecFromStr("0.1"), + math.LegacyMustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.1"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{}, uint32(2), - sdk.MustNewDecFromStr("0.05"), + math.LegacyMustNewDecFromStr("0.05"), time.Now(), time.Now().AddDate(0, 1, 0), ), @@ -226,13 +220,13 @@ func TestMsgCreateBatchAuction(t *testing.T) { "start price must be positive: invalid request", types.NewMsgCreateBatchAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0"), - sdk.MustNewDecFromStr("0.1"), + math.LegacyMustNewDecFromStr("0"), + math.LegacyMustNewDecFromStr("0.1"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{}, uint32(2), - sdk.MustNewDecFromStr("0.05"), + math.LegacyMustNewDecFromStr("0.05"), time.Now(), time.Now().AddDate(0, 1, 0), ), @@ -241,13 +235,13 @@ func TestMsgCreateBatchAuction(t *testing.T) { "minimum price must be positive: invalid request", types.NewMsgCreateBatchAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.1"), - sdk.MustNewDecFromStr("0"), + math.LegacyMustNewDecFromStr("0.1"), + math.LegacyMustNewDecFromStr("0"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{}, uint32(2), - sdk.MustNewDecFromStr("0.05"), + math.LegacyMustNewDecFromStr("0.05"), time.Now(), time.Now().AddDate(0, 1, 0), ), @@ -256,13 +250,13 @@ func TestMsgCreateBatchAuction(t *testing.T) { "selling coin amount must be positive: invalid request", types.NewMsgCreateBatchAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), - sdk.MustNewDecFromStr("0.1"), + math.LegacyMustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.1"), sdk.NewInt64Coin("denom2", 0), "denom1", []types.VestingSchedule{}, uint32(2), - sdk.MustNewDecFromStr("0.05"), + math.LegacyMustNewDecFromStr("0.05"), time.Now(), time.Now().AddDate(0, 1, 0), ), @@ -271,13 +265,13 @@ func TestMsgCreateBatchAuction(t *testing.T) { "selling coin denom must not be the same as paying coin denom: invalid request", types.NewMsgCreateBatchAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), - sdk.MustNewDecFromStr("0.1"), + math.LegacyMustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.1"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom2", []types.VestingSchedule{}, uint32(2), - sdk.MustNewDecFromStr("0.05"), + math.LegacyMustNewDecFromStr("0.05"), time.Now(), time.Now().AddDate(0, 1, 0), ), @@ -286,13 +280,13 @@ func TestMsgCreateBatchAuction(t *testing.T) { "end time must be set after start time: invalid request", types.NewMsgCreateBatchAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), - sdk.MustNewDecFromStr("0.1"), + math.LegacyMustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.1"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{}, uint32(2), - sdk.MustNewDecFromStr("0.05"), + math.LegacyMustNewDecFromStr("0.05"), time.Now(), time.Now().AddDate(-1, 0, 0), ), @@ -301,18 +295,18 @@ func TestMsgCreateBatchAuction(t *testing.T) { "vesting weight must be positive: invalid vesting schedules", types.NewMsgCreateBatchAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), - sdk.MustNewDecFromStr("0.1"), + math.LegacyMustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.1"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{ { time.Now().AddDate(0, 1, 0).AddDate(0, 6, 0), - sdk.ZeroDec(), + math.LegacyZeroDec(), }, }, uint32(2), - sdk.MustNewDecFromStr("0.05"), + math.LegacyMustNewDecFromStr("0.05"), time.Now(), time.Now().AddDate(0, 1, 0), ), @@ -321,18 +315,18 @@ func TestMsgCreateBatchAuction(t *testing.T) { "vesting weight must not be greater than 1: invalid vesting schedules", types.NewMsgCreateBatchAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), - sdk.MustNewDecFromStr("0.1"), + math.LegacyMustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.1"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{ { time.Now().AddDate(0, 1, 0).AddDate(0, 6, 0), - sdk.MustNewDecFromStr("1.1"), + math.LegacyMustNewDecFromStr("1.1"), }, }, uint32(2), - sdk.MustNewDecFromStr("0.05"), + math.LegacyMustNewDecFromStr("0.05"), time.Now(), time.Now().AddDate(0, 1, 0), ), @@ -341,18 +335,18 @@ func TestMsgCreateBatchAuction(t *testing.T) { "release time must be set after the end time: invalid vesting schedules", types.NewMsgCreateBatchAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), - sdk.MustNewDecFromStr("0.1"), + math.LegacyMustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.1"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{ { time.Now(), - sdk.MustNewDecFromStr("1.0"), + math.LegacyMustNewDecFromStr("1.0"), }, }, uint32(2), - sdk.MustNewDecFromStr("0.05"), + math.LegacyMustNewDecFromStr("0.05"), time.Now(), time.Now().AddDate(1, 0, 0), ), @@ -361,22 +355,22 @@ func TestMsgCreateBatchAuction(t *testing.T) { "release time must be chronological: invalid vesting schedules", types.NewMsgCreateBatchAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), - sdk.MustNewDecFromStr("0.1"), + math.LegacyMustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.1"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{ { time.Now().AddDate(0, 1, 0).AddDate(0, 6, 0), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), }, { time.Now().AddDate(0, 1, 0).AddDate(0, 3, 0), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), }, }, uint32(2), - sdk.MustNewDecFromStr("0.05"), + math.LegacyMustNewDecFromStr("0.05"), time.Now(), time.Now().AddDate(0, 1, 0), ), @@ -385,22 +379,22 @@ func TestMsgCreateBatchAuction(t *testing.T) { "total vesting weight must be equal to 1: invalid vesting schedules", types.NewMsgCreateBatchAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), - sdk.MustNewDecFromStr("0.1"), + math.LegacyMustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.1"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{ { time.Now().AddDate(0, 1, 0).AddDate(0, 6, 0), - sdk.MustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.5"), }, { time.Now().AddDate(0, 1, 0).AddDate(1, 0, 0), - sdk.MustNewDecFromStr("0.3"), + math.LegacyMustNewDecFromStr("0.3"), }, }, uint32(2), - sdk.MustNewDecFromStr("0.05"), + math.LegacyMustNewDecFromStr("0.05"), time.Now(), time.Now().AddDate(0, 1, 0), ), @@ -409,13 +403,13 @@ func TestMsgCreateBatchAuction(t *testing.T) { "extend rate must be positive: invalid request", types.NewMsgCreateBatchAuction( sdk.AccAddress(crypto.AddressHash([]byte("Auctioneer"))).String(), - sdk.MustNewDecFromStr("0.5"), - sdk.MustNewDecFromStr("0.1"), + math.LegacyMustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.1"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{}, uint32(2), - sdk.MustNewDecFromStr("-0.05"), + math.LegacyMustNewDecFromStr("-0.05"), time.Now(), time.Now().AddDate(0, 1, 0), ), @@ -424,13 +418,13 @@ func TestMsgCreateBatchAuction(t *testing.T) { "invalid auctioneer address: empty address string is not allowed: invalid address", types.NewMsgCreateBatchAuction( "", - sdk.MustNewDecFromStr("0.5"), - sdk.MustNewDecFromStr("0.1"), + math.LegacyMustNewDecFromStr("0.5"), + math.LegacyMustNewDecFromStr("0.1"), sdk.NewInt64Coin("denom2", 10_000_000_000_000), "denom1", []types.VestingSchedule{}, uint32(2), - sdk.MustNewDecFromStr("0.05"), + math.LegacyMustNewDecFromStr("0.05"), time.Now(), time.Now().AddDate(0, 1, 0), ), @@ -439,16 +433,10 @@ func TestMsgCreateBatchAuction(t *testing.T) { for _, tc := range testCases { require.IsType(t, &types.MsgCreateBatchAuction{}, tc.msg) - require.Equal(t, types.TypeMsgCreateBatchAuction, tc.msg.Type()) - require.Equal(t, types.RouterKey, tc.msg.Route()) - require.Equal(t, sdk.MustSortJSON(legacy.Cdc.MustMarshalJSON(tc.msg)), tc.msg.GetSignBytes()) err := tc.msg.ValidateBasic() if tc.expectedErr == "" { require.Nil(t, err) - signers := tc.msg.GetSigners() - require.Len(t, signers, 1) - require.Equal(t, tc.msg.GetAuctioneer(), signers[0]) } else { require.EqualError(t, err, tc.expectedErr) } @@ -478,16 +466,10 @@ func TestMsgCancelAuction(t *testing.T) { for _, tc := range testCases { require.IsType(t, &types.MsgCancelAuction{}, tc.msg) - require.Equal(t, types.TypeMsgCancelAuction, tc.msg.Type()) - require.Equal(t, types.RouterKey, tc.msg.Route()) - require.Equal(t, sdk.MustSortJSON(legacy.Cdc.MustMarshalJSON(tc.msg)), tc.msg.GetSignBytes()) err := tc.msg.ValidateBasic() if tc.expectedErr == "" { require.Nil(t, err) - signers := tc.msg.GetSigners() - require.Len(t, signers, 1) - require.Equal(t, tc.msg.GetAuctioneer(), signers[0]) } else { require.EqualError(t, err, tc.expectedErr) } @@ -505,7 +487,7 @@ func TestMsgPlaceBid(t *testing.T) { uint64(1), sdk.AccAddress(crypto.AddressHash([]byte("Bidder"))).String(), types.BidTypeBatchWorth, - sdk.OneDec(), + math.LegacyOneDec(), sdk.NewInt64Coin("denom2", 1000000), ), }, @@ -515,7 +497,7 @@ func TestMsgPlaceBid(t *testing.T) { uint64(1), sdk.AccAddress(crypto.AddressHash([]byte("Bidder"))).String(), types.BidTypeBatchWorth, - sdk.ZeroDec(), + math.LegacyZeroDec(), sdk.NewInt64Coin("denom2", 1000000), ), }, @@ -525,7 +507,7 @@ func TestMsgPlaceBid(t *testing.T) { uint64(1), sdk.AccAddress(crypto.AddressHash([]byte("Bidder"))).String(), types.BidTypeBatchWorth, - sdk.OneDec(), + math.LegacyOneDec(), sdk.NewInt64Coin("denom2", 0), ), }, @@ -535,7 +517,7 @@ func TestMsgPlaceBid(t *testing.T) { uint64(1), "", types.BidTypeBatchWorth, - sdk.OneDec(), + math.LegacyOneDec(), sdk.NewInt64Coin("denom2", 1000000), ), }, @@ -543,16 +525,10 @@ func TestMsgPlaceBid(t *testing.T) { for _, tc := range testCases { require.IsType(t, &types.MsgPlaceBid{}, tc.msg) - require.Equal(t, types.TypeMsgPlaceBid, tc.msg.Type()) - require.Equal(t, types.RouterKey, tc.msg.Route()) - require.Equal(t, sdk.MustSortJSON(legacy.Cdc.MustMarshalJSON(tc.msg)), tc.msg.GetSignBytes()) err := tc.msg.ValidateBasic() if tc.expectedErr == "" { require.Nil(t, err) - signers := tc.msg.GetSigners() - require.Len(t, signers, 1) - require.Equal(t, tc.msg.GetBidder(), signers[0]) } else { require.EqualError(t, err, tc.expectedErr) } @@ -570,7 +546,7 @@ func TestMsgModifyBid(t *testing.T) { uint64(1), sdk.AccAddress(crypto.AddressHash([]byte("Bidder"))).String(), uint64(0), - sdk.OneDec(), + math.LegacyOneDec(), sdk.NewInt64Coin("denom2", 1000000), ), }, @@ -580,7 +556,7 @@ func TestMsgModifyBid(t *testing.T) { uint64(1), sdk.AccAddress(crypto.AddressHash([]byte("Bidder"))).String(), uint64(0), - sdk.ZeroDec(), + math.LegacyZeroDec(), sdk.NewInt64Coin("denom2", 1000000), ), }, @@ -590,7 +566,7 @@ func TestMsgModifyBid(t *testing.T) { uint64(1), sdk.AccAddress(crypto.AddressHash([]byte("Bidder"))).String(), uint64(0), - sdk.OneDec(), + math.LegacyOneDec(), sdk.NewInt64Coin("denom2", 0), ), }, @@ -600,7 +576,7 @@ func TestMsgModifyBid(t *testing.T) { uint64(1), "", uint64(0), - sdk.OneDec(), + math.LegacyOneDec(), sdk.NewInt64Coin("denom2", 1000000), ), }, @@ -608,16 +584,10 @@ func TestMsgModifyBid(t *testing.T) { for _, tc := range testCases { require.IsType(t, &types.MsgModifyBid{}, tc.msg) - require.Equal(t, types.TypeMsgModifyBid, tc.msg.Type()) - require.Equal(t, types.RouterKey, tc.msg.Route()) - require.Equal(t, sdk.MustSortJSON(legacy.Cdc.MustMarshalJSON(tc.msg)), tc.msg.GetSignBytes()) err := tc.msg.ValidateBasic() if tc.expectedErr == "" { require.Nil(t, err) - signers := tc.msg.GetSigners() - require.Len(t, signers, 1) - require.Equal(t, tc.msg.GetBidder(), signers[0]) } else { require.EqualError(t, err, tc.expectedErr) } @@ -634,8 +604,9 @@ func TestAddAllowedBidder(t *testing.T) { types.NewMsgAddAllowedBidder( 1, types.AllowedBidder{ + 1, sdk.AccAddress(crypto.AddressHash([]byte("Bidder"))).String(), - sdk.NewInt(100_000_000), + math.NewInt(100_000_000), }, ), }, @@ -644,8 +615,9 @@ func TestAddAllowedBidder(t *testing.T) { types.NewMsgAddAllowedBidder( 1, types.AllowedBidder{ + 1, "", - sdk.NewInt(100_000_000), + math.NewInt(100_000_000), }, ), }, @@ -653,15 +625,9 @@ func TestAddAllowedBidder(t *testing.T) { for _, tc := range testCases { require.IsType(t, &types.MsgAddAllowedBidder{}, tc.msg) - require.Equal(t, types.TypeMsgAddAllowedBidder, tc.msg.Type()) - require.Equal(t, types.RouterKey, tc.msg.Route()) - require.Equal(t, sdk.MustSortJSON(legacy.Cdc.MustMarshalJSON(tc.msg)), tc.msg.GetSignBytes()) - err := tc.msg.ValidateBasic() if tc.expectedErr == "" { require.Nil(t, err) - signers := tc.msg.GetSigners() - require.Len(t, signers, 1) } else { require.EqualError(t, err, tc.expectedErr) } diff --git a/x/fundraising/types/params.go b/x/fundraising/types/params.go index f2023013..d5ed3602 100644 --- a/x/fundraising/types/params.go +++ b/x/fundraising/types/params.go @@ -1,12 +1,8 @@ package types import ( - "fmt" - - "gopkg.in/yaml.v2" - + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" ) const ( @@ -20,95 +16,49 @@ const ( MaxExtendedRound = 30 ) -// Parameter store keys. var ( - KeyAuctionCreationFee = []byte("AuctionCreationFee") - KeyPlaceBidFee = []byte("PlaceBidFee") - KeyExtendedPeriod = []byte("ExtendedPeriod") - - DefaultAuctionCreationFee = sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100_000_000))) + DefaultAuctionCreationFee = sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100_000_000))) DefaultPlaceBidFee = sdk.Coins{} DefaultExtendedPeriod = uint32(1) ) -var _ paramstypes.ParamSet = (*Params)(nil) - -// ParamKeyTable returns the parameter key table. -func ParamKeyTable() paramstypes.KeyTable { - return paramstypes.NewKeyTable().RegisterParamSet(&Params{}) +// NewParams creates a new Params instance. +func NewParams( + auctionCreationFee, + placeBidFee sdk.Coins, + extendedPeriod uint32, +) Params { + return Params{AuctionCreationFee: auctionCreationFee, PlaceBidFee: placeBidFee, ExtendedPeriod: extendedPeriod} } -// DefaultParams returns the default fundraising module parameters. +// DefaultParams returns a default set of parameters. func DefaultParams() Params { - return Params{ - AuctionCreationFee: DefaultAuctionCreationFee, - PlaceBidFee: DefaultPlaceBidFee, - ExtendedPeriod: DefaultExtendedPeriod, - } -} - -// ParamSetPairs implements paramstypes.ParamSet. -func (p *Params) ParamSetPairs() paramstypes.ParamSetPairs { - return paramstypes.ParamSetPairs{ - paramstypes.NewParamSetPair(KeyAuctionCreationFee, &p.AuctionCreationFee, validateAuctionCreationFee), - paramstypes.NewParamSetPair(KeyPlaceBidFee, &p.PlaceBidFee, validatePlaceBidFee), - paramstypes.NewParamSetPair(KeyExtendedPeriod, &p.ExtendedPeriod, validateExtendedPeriod), - } -} - -// String returns a human readable string representation of the parameters. -func (p Params) String() string { - out, _ := yaml.Marshal(p) - return string(out) + return NewParams(DefaultAuctionCreationFee, DefaultPlaceBidFee, DefaultExtendedPeriod) } -// Validate validates parameters. +// Validate validates the set of params. func (p Params) Validate() error { - for _, v := range []struct { - value interface{} - validator func(interface{}) error - }{ - {p.AuctionCreationFee, validateAuctionCreationFee}, - {p.ExtendedPeriod, validateExtendedPeriod}, - } { - if err := v.validator(v.value); err != nil { - return err - } + if err := validateAuctionCreationFee(p.AuctionCreationFee); err != nil { + return err } - return nil -} - -func validateAuctionCreationFee(i interface{}) error { - v, ok := i.(sdk.Coins) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) + if err := validatePlaceBidFee(p.PlaceBidFee); err != nil { + return err } - - if err := v.Validate(); err != nil { + if err := validateExtendedPeriod(p.ExtendedPeriod); err != nil { return err } return nil } -func validatePlaceBidFee(i interface{}) error { - v, ok := i.(sdk.Coins) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if err := v.Validate(); err != nil { - return err - } - - return nil +func validateAuctionCreationFee(v sdk.Coins) error { + return v.Validate() } -func validateExtendedPeriod(i interface{}) error { - _, ok := i.(uint32) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } +func validatePlaceBidFee(v sdk.Coins) error { + return v.Validate() +} +func validateExtendedPeriod(uint32) error { return nil } diff --git a/x/fundraising/types/params.pb.go b/x/fundraising/types/params.pb.go index 06f9face..da79131f 100644 --- a/x/fundraising/types/params.pb.go +++ b/x/fundraising/types/params.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: fundraising/params.proto +// source: fundraising/fundraising/v1/params.proto package types @@ -8,6 +8,7 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" 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" io "io" @@ -26,25 +27,26 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Params defines the set of params for the fundraising module. +// Params defines the parameters for the module. type Params struct { // auction_creation_fee specifies the fee for auction creation. // this prevents from spamming attack and it is collected in the community // pool - AuctionCreationFee github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=auction_creation_fee,json=auctionCreationFee,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"auction_creation_fee" yaml:"auction_creation_fee"` + AuctionCreationFee github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=auction_creation_fee,json=auctionCreationFee,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"auction_creation_fee"` // place_bid_fee specifies the fee for placing a bid for an auction. // this prevents from spamming attack and it is collected in the community // pool - PlaceBidFee github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=place_bid_fee,json=placeBidFee,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"place_bid_fee" yaml:"place_bid_fee"` + PlaceBidFee github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=place_bid_fee,json=placeBidFee,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"place_bid_fee"` // extended_period specifies the extended period that determines how long // the extended auction round lasts - ExtendedPeriod uint32 `protobuf:"varint,3,opt,name=extended_period,json=extendedPeriod,proto3" json:"extended_period,omitempty" yaml:"extended_period"` + ExtendedPeriod uint32 `protobuf:"varint,3,opt,name=extended_period,json=extendedPeriod,proto3" json:"extended_period,omitempty"` } -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_b7601b7e90a0f804, []int{0} + return fileDescriptor_3ee333e6a32caa0f, []int{0} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -73,39 +75,103 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo +func (m *Params) GetAuctionCreationFee() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.AuctionCreationFee + } + return nil +} + +func (m *Params) GetPlaceBidFee() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.PlaceBidFee + } + return nil +} + +func (m *Params) GetExtendedPeriod() uint32 { + if m != nil { + return m.ExtendedPeriod + } + return 0 +} + func init() { - proto.RegisterType((*Params)(nil), "fundraising.Params") + proto.RegisterType((*Params)(nil), "fundraising.fundraising.v1.Params") } -func init() { proto.RegisterFile("fundraising/params.proto", fileDescriptor_b7601b7e90a0f804) } +func init() { + proto.RegisterFile("fundraising/fundraising/v1/params.proto", fileDescriptor_3ee333e6a32caa0f) +} -var fileDescriptor_b7601b7e90a0f804 = []byte{ - // 361 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x48, 0x2b, 0xcd, 0x4b, - 0x29, 0x4a, 0xcc, 0x2c, 0xce, 0xcc, 0x4b, 0xd7, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, - 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x46, 0x92, 0x91, 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, 0x83, 0x28, 0x96, 0x92, 0x84, 0xc8, 0xc7, 0x83, 0x79, 0xfa, 0x10, 0x0e, 0x54, 0x4a, - 0x24, 0x3d, 0x3f, 0x3d, 0x1f, 0x22, 0x0e, 0x62, 0x41, 0x44, 0x95, 0x1a, 0x98, 0xb9, 0xd8, 0x02, - 0xc0, 0xd6, 0x09, 0xcd, 0x61, 0xe4, 0x12, 0x49, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0x8b, 0x4f, - 0x2e, 0x4a, 0x4d, 0x04, 0x33, 0xd2, 0x52, 0x53, 0x25, 0x18, 0x15, 0x98, 0x35, 0xb8, 0x8d, 0x24, - 0xf5, 0xa0, 0xc6, 0x81, 0xec, 0xd6, 0x83, 0xda, 0xad, 0xe7, 0x9c, 0x9f, 0x99, 0xe7, 0xe4, 0x7f, - 0xe2, 0x9e, 0x3c, 0xc3, 0xa7, 0x7b, 0xf2, 0xd2, 0x95, 0x89, 0xb9, 0x39, 0x56, 0x4a, 0xd8, 0x0c, - 0x51, 0x5a, 0x75, 0x5f, 0x5e, 0x23, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x17, - 0xea, 0x34, 0x28, 0xa5, 0x5b, 0x9c, 0x92, 0xad, 0x5f, 0x52, 0x59, 0x90, 0x5a, 0x0c, 0x36, 0xaf, - 0x38, 0x48, 0x08, 0x6a, 0x84, 0x33, 0xd4, 0x04, 0xb7, 0xd4, 0x54, 0xa1, 0x76, 0x46, 0x2e, 0xde, - 0x82, 0x9c, 0xc4, 0xe4, 0xd4, 0xf8, 0xa4, 0xcc, 0x14, 0xb0, 0xbb, 0x98, 0x08, 0xb9, 0xcb, 0x03, - 0xea, 0x2e, 0x11, 0x88, 0xbb, 0x50, 0x74, 0x93, 0xe6, 0x20, 0x6e, 0xb0, 0x5e, 0xa7, 0xcc, 0x14, - 0x90, 0x4b, 0x9c, 0xb9, 0xf8, 0x53, 0x2b, 0x4a, 0x52, 0xf3, 0x52, 0x52, 0x53, 0xe2, 0x0b, 0x52, - 0x8b, 0x32, 0xf3, 0x53, 0x24, 0x98, 0x15, 0x18, 0x35, 0x78, 0x9d, 0xa4, 0x3e, 0xdd, 0x93, 0x17, - 0x83, 0xd8, 0x85, 0xa6, 0x40, 0x29, 0x88, 0x0f, 0x26, 0x12, 0x00, 0x16, 0xb0, 0xe2, 0xe8, 0x58, - 0x20, 0xcf, 0x30, 0x63, 0x81, 0x3c, 0x83, 0x93, 0xff, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, - 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, - 0xcb, 0x31, 0x44, 0x99, 0x22, 0xb9, 0x0f, 0xac, 0xb9, 0x28, 0x37, 0x33, 0xaf, 0x44, 0x1f, 0x39, - 0xa9, 0x54, 0xa0, 0xf0, 0xc0, 0x4e, 0x4e, 0x62, 0x03, 0x47, 0xad, 0x31, 0x20, 0x00, 0x00, 0xff, - 0xff, 0xad, 0xf1, 0xf5, 0xb7, 0x54, 0x02, 0x00, 0x00, +var fileDescriptor_3ee333e6a32caa0f = []byte{ + // 370 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x52, 0x31, 0x4f, 0xc2, 0x40, + 0x18, 0xed, 0x41, 0xc2, 0x50, 0x44, 0x63, 0xc3, 0x00, 0x0c, 0x85, 0xb8, 0x80, 0x24, 0xf6, 0x52, + 0x8d, 0x8b, 0x23, 0x24, 0xac, 0x12, 0x46, 0x97, 0xe6, 0xda, 0x7e, 0xd4, 0x8b, 0xf4, 0xae, 0xe9, + 0x15, 0x02, 0x3f, 0xc0, 0xc5, 0xc9, 0xc4, 0xcd, 0xc9, 0xd1, 0x38, 0xf1, 0x33, 0x18, 0x19, 0x9d, + 0xd4, 0xc0, 0x80, 0xbf, 0xc1, 0xc9, 0xf4, 0x7a, 0x26, 0x75, 0x70, 0x75, 0x69, 0xdf, 0xf7, 0xde, + 0xdd, 0xf7, 0xde, 0xdd, 0x77, 0x7a, 0x7b, 0x3c, 0x65, 0x7e, 0x4c, 0xa8, 0xa0, 0x2c, 0xc0, 0x79, + 0x3c, 0xb3, 0x71, 0x44, 0x62, 0x12, 0x0a, 0x2b, 0x8a, 0x79, 0xc2, 0x8d, 0x46, 0x4e, 0xb4, 0xf2, + 0x78, 0x66, 0x37, 0x0e, 0x49, 0x48, 0x19, 0xc7, 0xf2, 0x9b, 0x2d, 0x6f, 0x98, 0x1e, 0x17, 0x21, + 0x17, 0xd8, 0x25, 0x02, 0xf0, 0xcc, 0x76, 0x21, 0x21, 0x36, 0xf6, 0x38, 0x65, 0x4a, 0xaf, 0x67, + 0xba, 0x23, 0x2b, 0x9c, 0x15, 0x4a, 0xaa, 0x06, 0x3c, 0xe0, 0x19, 0x9f, 0xa2, 0x8c, 0x3d, 0xfa, + 0x2a, 0xe8, 0xa5, 0xa1, 0x0c, 0x64, 0x3c, 0x20, 0xbd, 0x4a, 0xa6, 0x5e, 0x42, 0x39, 0x73, 0xbc, + 0x18, 0x88, 0x04, 0x63, 0x80, 0x1a, 0x6a, 0x15, 0x3b, 0xe5, 0xd3, 0xba, 0xa5, 0xda, 0xa5, 0xde, + 0x96, 0xf2, 0xb6, 0xfa, 0x9c, 0xb2, 0xde, 0x60, 0xf5, 0xd6, 0xd4, 0x5e, 0xde, 0x9b, 0x9d, 0x80, + 0x26, 0xd7, 0x53, 0xd7, 0xf2, 0x78, 0xa8, 0xbc, 0xd5, 0xef, 0x44, 0xf8, 0x37, 0x38, 0x59, 0x44, + 0x20, 0xe4, 0x06, 0xf1, 0xb8, 0x5b, 0x76, 0xf7, 0x26, 0x10, 0x10, 0x6f, 0xe1, 0xa4, 0xe9, 0xc5, + 0xf3, 0x6e, 0xd9, 0x45, 0x23, 0x43, 0xd9, 0xf7, 0x95, 0xfb, 0x00, 0xc0, 0xb8, 0x45, 0x7a, 0x25, + 0x9a, 0x10, 0x0f, 0x1c, 0x97, 0xfa, 0x32, 0x4e, 0xe1, 0xbf, 0xe2, 0x94, 0xa5, 0x6f, 0x8f, 0xfa, + 0x69, 0x8e, 0xb6, 0x7e, 0x00, 0xf3, 0x04, 0x98, 0x0f, 0xbe, 0x13, 0x41, 0x4c, 0xb9, 0x5f, 0x2b, + 0xb6, 0x50, 0xa7, 0x32, 0xda, 0xff, 0xa1, 0x87, 0x92, 0xbd, 0x38, 0xfe, 0x7c, 0x6a, 0xa2, 0xbb, + 0xdd, 0xb2, 0xdb, 0xca, 0xcf, 0x7d, 0xfe, 0xeb, 0x15, 0x64, 0x37, 0xde, 0xbb, 0x5c, 0x6d, 0x4c, + 0xb4, 0xde, 0x98, 0xe8, 0x63, 0x63, 0xa2, 0xfb, 0xad, 0xa9, 0xad, 0xb7, 0xa6, 0xf6, 0xba, 0x35, + 0xb5, 0xab, 0xf3, 0x5c, 0x74, 0xd9, 0x3d, 0x0e, 0x29, 0x4b, 0xf0, 0xdf, 0x1d, 0xe5, 0x69, 0xdc, + 0x92, 0x1c, 0xea, 0xd9, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x41, 0xef, 0x15, 0x7f, 0x02, + 0x00, 0x00, } +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.AuctionCreationFee) != len(that1.AuctionCreationFee) { + return false + } + for i := range this.AuctionCreationFee { + if !this.AuctionCreationFee[i].Equal(&that1.AuctionCreationFee[i]) { + return false + } + } + if len(this.PlaceBidFee) != len(that1.PlaceBidFee) { + return false + } + for i := range this.PlaceBidFee { + if !this.PlaceBidFee[i].Equal(&that1.PlaceBidFee[i]) { + return false + } + } + if this.ExtendedPeriod != that1.ExtendedPeriod { + return false + } + return true +} func (m *Params) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) diff --git a/x/fundraising/types/params_test.go b/x/fundraising/types/params_test.go index a1f4b007..656e9804 100644 --- a/x/fundraising/types/params_test.go +++ b/x/fundraising/types/params_test.go @@ -1,27 +1,18 @@ package types_test import ( - "reflect" "testing" sdk "github.com/cosmos/cosmos-sdk/types" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/stretchr/testify/require" "github.com/tendermint/fundraising/x/fundraising/types" ) func TestParams(t *testing.T) { - require.IsType(t, paramstypes.KeyTable{}, types.ParamKeyTable()) - defaultParams := types.DefaultParams() - paramsStr := `auction_creation_fee: -- denom: stake - amount: "100000000" -place_bid_fee: [] -extended_period: 1 -` + paramsStr := `auction_creation_fee: extended_period:1 ` require.Equal(t, paramsStr, defaultParams.String()) } @@ -55,20 +46,10 @@ func TestParamsValidate(t *testing.T) { tc.configure(¶ms) err := params.Validate() - var err2 error - for _, p := range params.ParamSetPairs() { - err := p.ValidatorFn(reflect.ValueOf(p.Value).Elem().Interface()) - if err != nil { - err2 = err - break - } - } if tc.expectedErr != "" { require.EqualError(t, err, tc.expectedErr) - require.EqualError(t, err2, tc.expectedErr) } else { require.Nil(t, err) - require.Nil(t, err2) } }) } diff --git a/x/fundraising/types/query.pb.go b/x/fundraising/types/query.pb.go index 9ac8ba86..d2a35818 100644 --- a/x/fundraising/types/query.pb.go +++ b/x/fundraising/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: fundraising/query.proto +// source: fundraising/fundraising/v1/query.proto package types @@ -9,6 +9,7 @@ import ( _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/codec/types" query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -40,7 +41,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c670d5b855fb1401, []int{0} + return fileDescriptor_8be3ab6819f1d50c, []int{0} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -79,7 +80,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c670d5b855fb1401, []int{1} + return fileDescriptor_8be3ab6819f1d50c, []int{1} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -115,25 +116,25 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } -// QueryAuctionsRequest is request type for the Query/Auctions RPC method. -type QueryAuctionsRequest struct { +// QueryAllAuctionRequest is request type for the Query/Auctions RPC method. +type QueryAllAuctionRequest struct { Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryAuctionsRequest) Reset() { *m = QueryAuctionsRequest{} } -func (m *QueryAuctionsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAuctionsRequest) ProtoMessage() {} -func (*QueryAuctionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c670d5b855fb1401, []int{2} +func (m *QueryAllAuctionRequest) Reset() { *m = QueryAllAuctionRequest{} } +func (m *QueryAllAuctionRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllAuctionRequest) ProtoMessage() {} +func (*QueryAllAuctionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_8be3ab6819f1d50c, []int{2} } -func (m *QueryAuctionsRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryAllAuctionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAuctionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAllAuctionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAuctionsRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAllAuctionRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -143,59 +144,59 @@ func (m *QueryAuctionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *QueryAuctionsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAuctionsRequest.Merge(m, src) +func (m *QueryAllAuctionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllAuctionRequest.Merge(m, src) } -func (m *QueryAuctionsRequest) XXX_Size() int { +func (m *QueryAllAuctionRequest) XXX_Size() int { return m.Size() } -func (m *QueryAuctionsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAuctionsRequest.DiscardUnknown(m) +func (m *QueryAllAuctionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllAuctionRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryAuctionsRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryAllAuctionRequest proto.InternalMessageInfo -func (m *QueryAuctionsRequest) GetStatus() string { +func (m *QueryAllAuctionRequest) GetStatus() string { if m != nil { return m.Status } return "" } -func (m *QueryAuctionsRequest) GetType() string { +func (m *QueryAllAuctionRequest) GetType() string { if m != nil { return m.Type } return "" } -func (m *QueryAuctionsRequest) GetPagination() *query.PageRequest { +func (m *QueryAllAuctionRequest) GetPagination() *query.PageRequest { if m != nil { return m.Pagination } return nil } -// QueryAuctionsResponse is response type for the Query/Auctions RPC method. -type QueryAuctionsResponse struct { +// QueryAllAuctionResponse is response type for the Query/Auctions RPC method. +type QueryAllAuctionResponse struct { // auctions specifies the existing auctions - Auctions []*types.Any `protobuf:"bytes,1,rep,name=auctions,proto3" json:"auctions,omitempty"` + Auction []*types.Any `protobuf:"bytes,1,rep,name=auction,proto3" json:"auction,omitempty"` // pagination defines the pagination in the response Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryAuctionsResponse) Reset() { *m = QueryAuctionsResponse{} } -func (m *QueryAuctionsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAuctionsResponse) ProtoMessage() {} -func (*QueryAuctionsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c670d5b855fb1401, []int{3} +func (m *QueryAllAuctionResponse) Reset() { *m = QueryAllAuctionResponse{} } +func (m *QueryAllAuctionResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllAuctionResponse) ProtoMessage() {} +func (*QueryAllAuctionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_8be3ab6819f1d50c, []int{3} } -func (m *QueryAuctionsResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryAllAuctionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAuctionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAllAuctionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAuctionsResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAllAuctionResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -205,49 +206,49 @@ func (m *QueryAuctionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (m *QueryAuctionsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAuctionsResponse.Merge(m, src) +func (m *QueryAllAuctionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllAuctionResponse.Merge(m, src) } -func (m *QueryAuctionsResponse) XXX_Size() int { +func (m *QueryAllAuctionResponse) XXX_Size() int { return m.Size() } -func (m *QueryAuctionsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAuctionsResponse.DiscardUnknown(m) +func (m *QueryAllAuctionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllAuctionResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryAuctionsResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryAllAuctionResponse proto.InternalMessageInfo -func (m *QueryAuctionsResponse) GetAuctions() []*types.Any { +func (m *QueryAllAuctionResponse) GetAuction() []*types.Any { if m != nil { - return m.Auctions + return m.Auction } return nil } -func (m *QueryAuctionsResponse) GetPagination() *query.PageResponse { +func (m *QueryAllAuctionResponse) GetPagination() *query.PageResponse { if m != nil { return m.Pagination } return nil } -// QueryAuctionRequest is the request type for the Query/Auction RPC method. -type QueryAuctionRequest struct { +// QueryGetAuctionRequest is the request type for the Query/Auction RPC method. +type QueryGetAuctionRequest struct { AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` } -func (m *QueryAuctionRequest) Reset() { *m = QueryAuctionRequest{} } -func (m *QueryAuctionRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAuctionRequest) ProtoMessage() {} -func (*QueryAuctionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c670d5b855fb1401, []int{4} +func (m *QueryGetAuctionRequest) Reset() { *m = QueryGetAuctionRequest{} } +func (m *QueryGetAuctionRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetAuctionRequest) ProtoMessage() {} +func (*QueryGetAuctionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_8be3ab6819f1d50c, []int{4} } -func (m *QueryAuctionRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryGetAuctionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAuctionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryGetAuctionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAuctionRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryGetAuctionRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -257,42 +258,42 @@ func (m *QueryAuctionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *QueryAuctionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAuctionRequest.Merge(m, src) +func (m *QueryGetAuctionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetAuctionRequest.Merge(m, src) } -func (m *QueryAuctionRequest) XXX_Size() int { +func (m *QueryGetAuctionRequest) XXX_Size() int { return m.Size() } -func (m *QueryAuctionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAuctionRequest.DiscardUnknown(m) +func (m *QueryGetAuctionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetAuctionRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryAuctionRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryGetAuctionRequest proto.InternalMessageInfo -func (m *QueryAuctionRequest) GetAuctionId() uint64 { +func (m *QueryGetAuctionRequest) GetAuctionId() uint64 { if m != nil { return m.AuctionId } return 0 } -// QueryAuctionResponse is the response type for the Query/Auction RPC method. -type QueryAuctionResponse struct { +// QueryGetAuctionResponse is the response type for the Query/Auction RPC method. +type QueryGetAuctionResponse struct { Auction *types.Any `protobuf:"bytes,1,opt,name=auction,proto3" json:"auction,omitempty"` } -func (m *QueryAuctionResponse) Reset() { *m = QueryAuctionResponse{} } -func (m *QueryAuctionResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAuctionResponse) ProtoMessage() {} -func (*QueryAuctionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c670d5b855fb1401, []int{5} +func (m *QueryGetAuctionResponse) Reset() { *m = QueryGetAuctionResponse{} } +func (m *QueryGetAuctionResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetAuctionResponse) ProtoMessage() {} +func (*QueryGetAuctionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_8be3ab6819f1d50c, []int{5} } -func (m *QueryAuctionResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryGetAuctionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAuctionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryGetAuctionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAuctionResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryGetAuctionResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -302,44 +303,43 @@ func (m *QueryAuctionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *QueryAuctionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAuctionResponse.Merge(m, src) +func (m *QueryGetAuctionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetAuctionResponse.Merge(m, src) } -func (m *QueryAuctionResponse) XXX_Size() int { +func (m *QueryGetAuctionResponse) XXX_Size() int { return m.Size() } -func (m *QueryAuctionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAuctionResponse.DiscardUnknown(m) +func (m *QueryGetAuctionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetAuctionResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryAuctionResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryGetAuctionResponse proto.InternalMessageInfo -func (m *QueryAuctionResponse) GetAuction() *types.Any { +func (m *QueryGetAuctionResponse) GetAuction() *types.Any { if m != nil { return m.Auction } return nil } -// QueryAllowedBidderRequest is the request type for the Query/AllowedBidder RPC -// method. -type QueryAllowedBidderRequest struct { - AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` - Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` +// QueryAllowedBidderRequest is the request type for the Query/AllowedBidder RPC method. +type QueryAllAllowedBidderRequest struct { + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryAllowedBidderRequest) Reset() { *m = QueryAllowedBidderRequest{} } -func (m *QueryAllowedBidderRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllowedBidderRequest) ProtoMessage() {} -func (*QueryAllowedBidderRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c670d5b855fb1401, []int{6} +func (m *QueryAllAllowedBidderRequest) Reset() { *m = QueryAllAllowedBidderRequest{} } +func (m *QueryAllAllowedBidderRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllAllowedBidderRequest) ProtoMessage() {} +func (*QueryAllAllowedBidderRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_8be3ab6819f1d50c, []int{6} } -func (m *QueryAllowedBidderRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryAllAllowedBidderRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAllowedBidderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAllAllowedBidderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAllowedBidderRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAllAllowedBidderRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -349,50 +349,51 @@ func (m *QueryAllowedBidderRequest) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (m *QueryAllowedBidderRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllowedBidderRequest.Merge(m, src) +func (m *QueryAllAllowedBidderRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllAllowedBidderRequest.Merge(m, src) } -func (m *QueryAllowedBidderRequest) XXX_Size() int { +func (m *QueryAllAllowedBidderRequest) XXX_Size() int { return m.Size() } -func (m *QueryAllowedBidderRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllowedBidderRequest.DiscardUnknown(m) +func (m *QueryAllAllowedBidderRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllAllowedBidderRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryAllowedBidderRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryAllAllowedBidderRequest proto.InternalMessageInfo -func (m *QueryAllowedBidderRequest) GetAuctionId() uint64 { +func (m *QueryAllAllowedBidderRequest) GetAuctionId() uint64 { if m != nil { return m.AuctionId } return 0 } -func (m *QueryAllowedBidderRequest) GetBidder() string { +func (m *QueryAllAllowedBidderRequest) GetPagination() *query.PageRequest { if m != nil { - return m.Bidder + return m.Pagination } - return "" + return nil } -// QueryAllowedBidderResponse is the response type for the Query/AllowedBidder -// RPC method. -type QueryAllowedBidderResponse struct { - AllowedBidder AllowedBidder `protobuf:"bytes,1,opt,name=allowed_bidder,json=allowedBidder,proto3" json:"allowed_bidder"` +// QueryAllowedBidderResponse is the response type for the Query/AllowedBidder RPC method. +type QueryAllAllowedBidderResponse struct { + AllowedBidder []AllowedBidder `protobuf:"bytes,1,rep,name=allowed_bidder,json=allowedBidder,proto3" json:"allowed_bidder"` + // pagination defines the pagination in the response + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryAllowedBidderResponse) Reset() { *m = QueryAllowedBidderResponse{} } -func (m *QueryAllowedBidderResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllowedBidderResponse) ProtoMessage() {} -func (*QueryAllowedBidderResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c670d5b855fb1401, []int{7} +func (m *QueryAllAllowedBidderResponse) Reset() { *m = QueryAllAllowedBidderResponse{} } +func (m *QueryAllAllowedBidderResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllAllowedBidderResponse) ProtoMessage() {} +func (*QueryAllAllowedBidderResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_8be3ab6819f1d50c, []int{7} } -func (m *QueryAllowedBidderResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryAllAllowedBidderResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAllowedBidderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAllAllowedBidderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAllowedBidderResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAllAllowedBidderResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -402,44 +403,51 @@ func (m *QueryAllowedBidderResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *QueryAllowedBidderResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllowedBidderResponse.Merge(m, src) +func (m *QueryAllAllowedBidderResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllAllowedBidderResponse.Merge(m, src) } -func (m *QueryAllowedBidderResponse) XXX_Size() int { +func (m *QueryAllAllowedBidderResponse) XXX_Size() int { return m.Size() } -func (m *QueryAllowedBidderResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllowedBidderResponse.DiscardUnknown(m) +func (m *QueryAllAllowedBidderResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllAllowedBidderResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryAllowedBidderResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryAllAllowedBidderResponse proto.InternalMessageInfo -func (m *QueryAllowedBidderResponse) GetAllowedBidder() AllowedBidder { +func (m *QueryAllAllowedBidderResponse) GetAllowedBidder() []AllowedBidder { if m != nil { return m.AllowedBidder } - return AllowedBidder{} + return nil } -// QueryAllowedBiddersRequest is the request type for the Query/AllowedBidders -// RPC method. -type QueryAllowedBiddersRequest struct { - AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +func (m *QueryAllAllowedBidderResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryAllowedBidderRequest is the request type for the Query/AllowedBidder RPC +// method. +type QueryGetAllowedBidderRequest struct { + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` } -func (m *QueryAllowedBiddersRequest) Reset() { *m = QueryAllowedBiddersRequest{} } -func (m *QueryAllowedBiddersRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllowedBiddersRequest) ProtoMessage() {} -func (*QueryAllowedBiddersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c670d5b855fb1401, []int{8} +func (m *QueryGetAllowedBidderRequest) Reset() { *m = QueryGetAllowedBidderRequest{} } +func (m *QueryGetAllowedBidderRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetAllowedBidderRequest) ProtoMessage() {} +func (*QueryGetAllowedBidderRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_8be3ab6819f1d50c, []int{8} } -func (m *QueryAllowedBiddersRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryGetAllowedBidderRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAllowedBiddersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryGetAllowedBidderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAllowedBiddersRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryGetAllowedBidderRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -449,52 +457,50 @@ func (m *QueryAllowedBiddersRequest) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *QueryAllowedBiddersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllowedBiddersRequest.Merge(m, src) +func (m *QueryGetAllowedBidderRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetAllowedBidderRequest.Merge(m, src) } -func (m *QueryAllowedBiddersRequest) XXX_Size() int { +func (m *QueryGetAllowedBidderRequest) XXX_Size() int { return m.Size() } -func (m *QueryAllowedBiddersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllowedBiddersRequest.DiscardUnknown(m) +func (m *QueryGetAllowedBidderRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetAllowedBidderRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryAllowedBiddersRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryGetAllowedBidderRequest proto.InternalMessageInfo -func (m *QueryAllowedBiddersRequest) GetAuctionId() uint64 { +func (m *QueryGetAllowedBidderRequest) GetAuctionId() uint64 { if m != nil { return m.AuctionId } return 0 } -func (m *QueryAllowedBiddersRequest) GetPagination() *query.PageRequest { +func (m *QueryGetAllowedBidderRequest) GetBidder() string { if m != nil { - return m.Pagination + return m.Bidder } - return nil + return "" } -// QueryAllowedBiddersResponse is the response type for the Query/AllowedBidders +// QueryAllowedBidderResponse is the response type for the Query/AllowedBidder // RPC method. -type QueryAllowedBiddersResponse struct { - AllowedBidders []AllowedBidder `protobuf:"bytes,1,rep,name=allowed_bidders,json=allowedBidders,proto3" json:"allowed_bidders"` - // pagination defines the pagination in the response - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +type QueryGetAllowedBidderResponse struct { + AllowedBidder AllowedBidder `protobuf:"bytes,1,opt,name=allowed_bidder,json=allowedBidder,proto3" json:"allowed_bidder"` } -func (m *QueryAllowedBiddersResponse) Reset() { *m = QueryAllowedBiddersResponse{} } -func (m *QueryAllowedBiddersResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllowedBiddersResponse) ProtoMessage() {} -func (*QueryAllowedBiddersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c670d5b855fb1401, []int{9} +func (m *QueryGetAllowedBidderResponse) Reset() { *m = QueryGetAllowedBidderResponse{} } +func (m *QueryGetAllowedBidderResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetAllowedBidderResponse) ProtoMessage() {} +func (*QueryGetAllowedBidderResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_8be3ab6819f1d50c, []int{9} } -func (m *QueryAllowedBiddersResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryGetAllowedBidderResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAllowedBiddersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryGetAllowedBidderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAllowedBiddersResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryGetAllowedBidderResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -504,52 +510,43 @@ func (m *QueryAllowedBiddersResponse) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *QueryAllowedBiddersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllowedBiddersResponse.Merge(m, src) +func (m *QueryGetAllowedBidderResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetAllowedBidderResponse.Merge(m, src) } -func (m *QueryAllowedBiddersResponse) XXX_Size() int { +func (m *QueryGetAllowedBidderResponse) XXX_Size() int { return m.Size() } -func (m *QueryAllowedBiddersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllowedBiddersResponse.DiscardUnknown(m) +func (m *QueryGetAllowedBidderResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetAllowedBidderResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryAllowedBiddersResponse proto.InternalMessageInfo - -func (m *QueryAllowedBiddersResponse) GetAllowedBidders() []AllowedBidder { - if m != nil { - return m.AllowedBidders - } - return nil -} +var xxx_messageInfo_QueryGetAllowedBidderResponse proto.InternalMessageInfo -func (m *QueryAllowedBiddersResponse) GetPagination() *query.PageResponse { +func (m *QueryGetAllowedBidderResponse) GetAllowedBidder() AllowedBidder { if m != nil { - return m.Pagination + return m.AllowedBidder } - return nil + return AllowedBidder{} } -// QueryBidsRequest is request type for the Query/Bids RPC method. -type QueryBidsRequest struct { - AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` - Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` - IsMatched string `protobuf:"bytes,3,opt,name=is_matched,json=isMatched,proto3" json:"is_matched,omitempty"` - Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty"` +// QueryGetBidRequest is the request type for the Query/Sequence RPC method. +type QueryGetBidRequest struct { + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + BidId uint64 `protobuf:"varint,2,opt,name=bid_id,json=bidId,proto3" json:"bid_id,omitempty"` } -func (m *QueryBidsRequest) Reset() { *m = QueryBidsRequest{} } -func (m *QueryBidsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryBidsRequest) ProtoMessage() {} -func (*QueryBidsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c670d5b855fb1401, []int{10} +func (m *QueryGetBidRequest) Reset() { *m = QueryGetBidRequest{} } +func (m *QueryGetBidRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetBidRequest) ProtoMessage() {} +func (*QueryGetBidRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_8be3ab6819f1d50c, []int{10} } -func (m *QueryBidsRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryGetBidRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryBidsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryGetBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryBidsRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryGetBidRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -559,66 +556,50 @@ func (m *QueryBidsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *QueryBidsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryBidsRequest.Merge(m, src) +func (m *QueryGetBidRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetBidRequest.Merge(m, src) } -func (m *QueryBidsRequest) XXX_Size() int { +func (m *QueryGetBidRequest) XXX_Size() int { return m.Size() } -func (m *QueryBidsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryBidsRequest.DiscardUnknown(m) +func (m *QueryGetBidRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetBidRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryBidsRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryGetBidRequest proto.InternalMessageInfo -func (m *QueryBidsRequest) GetAuctionId() uint64 { +func (m *QueryGetBidRequest) GetAuctionId() uint64 { if m != nil { return m.AuctionId } return 0 } -func (m *QueryBidsRequest) GetBidder() string { - if m != nil { - return m.Bidder - } - return "" -} - -func (m *QueryBidsRequest) GetIsMatched() string { - if m != nil { - return m.IsMatched - } - return "" -} - -func (m *QueryBidsRequest) GetPagination() *query.PageRequest { +func (m *QueryGetBidRequest) GetBidId() uint64 { if m != nil { - return m.Pagination + return m.BidId } - return nil + return 0 } -// QueryBidsResponse is response type for the Query/Bids RPC method. -type QueryBidsResponse struct { - // bids specifies the existing bids - Bids []Bid `protobuf:"bytes,1,rep,name=bids,proto3" json:"bids"` - // pagination defines the pagination in the response - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +// QueryGetBidResponse is response type for the Query/Sequence RPC method. +type QueryGetBidResponse struct { + // bid specifies specific bid + Bid Bid `protobuf:"bytes,1,opt,name=bid,proto3" json:"bid"` } -func (m *QueryBidsResponse) Reset() { *m = QueryBidsResponse{} } -func (m *QueryBidsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryBidsResponse) ProtoMessage() {} -func (*QueryBidsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c670d5b855fb1401, []int{11} +func (m *QueryGetBidResponse) Reset() { *m = QueryGetBidResponse{} } +func (m *QueryGetBidResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetBidResponse) ProtoMessage() {} +func (*QueryGetBidResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_8be3ab6819f1d50c, []int{11} } -func (m *QueryBidsResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryGetBidResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryBidsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryGetBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryBidsResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryGetBidResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -628,50 +609,45 @@ func (m *QueryBidsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *QueryBidsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryBidsResponse.Merge(m, src) +func (m *QueryGetBidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetBidResponse.Merge(m, src) } -func (m *QueryBidsResponse) XXX_Size() int { +func (m *QueryGetBidResponse) XXX_Size() int { return m.Size() } -func (m *QueryBidsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryBidsResponse.DiscardUnknown(m) +func (m *QueryGetBidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetBidResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryBidsResponse proto.InternalMessageInfo - -func (m *QueryBidsResponse) GetBids() []Bid { - if m != nil { - return m.Bids - } - return nil -} +var xxx_messageInfo_QueryGetBidResponse proto.InternalMessageInfo -func (m *QueryBidsResponse) GetPagination() *query.PageResponse { +func (m *QueryGetBidResponse) GetBid() Bid { if m != nil { - return m.Pagination + return m.Bid } - return nil + return Bid{} } -// QueryBidRequest is the request type for the Query/Sequence RPC method. -type QueryBidRequest struct { - AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` - BidId uint64 `protobuf:"varint,2,opt,name=bid_id,json=bidId,proto3" json:"bid_id,omitempty"` +// QueryBidsRequest is request type for the Query/Bids RPC method. +type QueryAllBidRequest struct { + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` + IsMatched string `protobuf:"bytes,3,opt,name=is_matched,json=isMatched,proto3" json:"is_matched,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryBidRequest) Reset() { *m = QueryBidRequest{} } -func (m *QueryBidRequest) String() string { return proto.CompactTextString(m) } -func (*QueryBidRequest) ProtoMessage() {} -func (*QueryBidRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c670d5b855fb1401, []int{12} +func (m *QueryAllBidRequest) Reset() { *m = QueryAllBidRequest{} } +func (m *QueryAllBidRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllBidRequest) ProtoMessage() {} +func (*QueryAllBidRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_8be3ab6819f1d50c, []int{12} } -func (m *QueryBidRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryAllBidRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAllBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryBidRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAllBidRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -681,50 +657,66 @@ func (m *QueryBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (m *QueryBidRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryBidRequest.Merge(m, src) +func (m *QueryAllBidRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllBidRequest.Merge(m, src) } -func (m *QueryBidRequest) XXX_Size() int { +func (m *QueryAllBidRequest) XXX_Size() int { return m.Size() } -func (m *QueryBidRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryBidRequest.DiscardUnknown(m) +func (m *QueryAllBidRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllBidRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryBidRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryAllBidRequest proto.InternalMessageInfo -func (m *QueryBidRequest) GetAuctionId() uint64 { +func (m *QueryAllBidRequest) GetAuctionId() uint64 { if m != nil { return m.AuctionId } return 0 } -func (m *QueryBidRequest) GetBidId() uint64 { +func (m *QueryAllBidRequest) GetBidder() string { if m != nil { - return m.BidId + return m.Bidder } - return 0 + return "" } -// QueryBidResponse is response type for the Query/Sequence RPC method. -type QueryBidResponse struct { - // bid specifies specific bid - Bid Bid `protobuf:"bytes,1,opt,name=bid,proto3" json:"bid"` +func (m *QueryAllBidRequest) GetIsMatched() string { + if m != nil { + return m.IsMatched + } + return "" +} + +func (m *QueryAllBidRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryBidsResponse is response type for the Query/Bids RPC method. +type QueryAllBidResponse struct { + // bids specifies the existing bids + Bid []Bid `protobuf:"bytes,1,rep,name=bid,proto3" json:"bid"` + // pagination defines the pagination in the response + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryBidResponse) Reset() { *m = QueryBidResponse{} } -func (m *QueryBidResponse) String() string { return proto.CompactTextString(m) } -func (*QueryBidResponse) ProtoMessage() {} -func (*QueryBidResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c670d5b855fb1401, []int{13} +func (m *QueryAllBidResponse) Reset() { *m = QueryAllBidResponse{} } +func (m *QueryAllBidResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllBidResponse) ProtoMessage() {} +func (*QueryAllBidResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_8be3ab6819f1d50c, []int{13} } -func (m *QueryBidResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryAllBidResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAllBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryBidResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAllBidResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -734,42 +726,50 @@ func (m *QueryBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *QueryBidResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryBidResponse.Merge(m, src) +func (m *QueryAllBidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllBidResponse.Merge(m, src) } -func (m *QueryBidResponse) XXX_Size() int { +func (m *QueryAllBidResponse) XXX_Size() int { return m.Size() } -func (m *QueryBidResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryBidResponse.DiscardUnknown(m) +func (m *QueryAllBidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllBidResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryBidResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryAllBidResponse proto.InternalMessageInfo -func (m *QueryBidResponse) GetBid() Bid { +func (m *QueryAllBidResponse) GetBid() []Bid { if m != nil { return m.Bid } - return Bid{} + return nil } -// QueryVestingsRequest is request type for the Query/Vestings RPC method. -type QueryVestingsRequest struct { - AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` +func (m *QueryAllBidResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryAllVestingQueueRequest is request type for the Query/Vestings RPC method. +type QueryAllVestingQueueRequest struct { + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryVestingsRequest) Reset() { *m = QueryVestingsRequest{} } -func (m *QueryVestingsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryVestingsRequest) ProtoMessage() {} -func (*QueryVestingsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c670d5b855fb1401, []int{14} +func (m *QueryAllVestingQueueRequest) Reset() { *m = QueryAllVestingQueueRequest{} } +func (m *QueryAllVestingQueueRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllVestingQueueRequest) ProtoMessage() {} +func (*QueryAllVestingQueueRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_8be3ab6819f1d50c, []int{14} } -func (m *QueryVestingsRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryAllVestingQueueRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryVestingsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAllVestingQueueRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryVestingsRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAllVestingQueueRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -779,43 +779,51 @@ func (m *QueryVestingsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *QueryVestingsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryVestingsRequest.Merge(m, src) +func (m *QueryAllVestingQueueRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllVestingQueueRequest.Merge(m, src) } -func (m *QueryVestingsRequest) XXX_Size() int { +func (m *QueryAllVestingQueueRequest) XXX_Size() int { return m.Size() } -func (m *QueryVestingsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryVestingsRequest.DiscardUnknown(m) +func (m *QueryAllVestingQueueRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllVestingQueueRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryVestingsRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryAllVestingQueueRequest proto.InternalMessageInfo -func (m *QueryVestingsRequest) GetAuctionId() uint64 { +func (m *QueryAllVestingQueueRequest) GetAuctionId() uint64 { if m != nil { return m.AuctionId } return 0 } -// QueryVestingsResponse is response type for the Query/Vestings RPC method. -type QueryVestingsResponse struct { +func (m *QueryAllVestingQueueRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryAllVestingQueueResponse is response type for the Query/Vestings RPC method. +type QueryAllVestingQueueResponse struct { // vestings specifies the existing vestings - Vestings []VestingQueue `protobuf:"bytes,1,rep,name=vestings,proto3" json:"vestings"` + VestingQueue []VestingQueue `protobuf:"bytes,1,rep,name=vestingQueue,proto3" json:"vestingQueue"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryVestingsResponse) Reset() { *m = QueryVestingsResponse{} } -func (m *QueryVestingsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryVestingsResponse) ProtoMessage() {} -func (*QueryVestingsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c670d5b855fb1401, []int{15} +func (m *QueryAllVestingQueueResponse) Reset() { *m = QueryAllVestingQueueResponse{} } +func (m *QueryAllVestingQueueResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllVestingQueueResponse) ProtoMessage() {} +func (*QueryAllVestingQueueResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_8be3ab6819f1d50c, []int{15} } -func (m *QueryVestingsResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryAllVestingQueueResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryVestingsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAllVestingQueueResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryVestingsResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAllVestingQueueResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -825,108 +833,121 @@ func (m *QueryVestingsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (m *QueryVestingsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryVestingsResponse.Merge(m, src) +func (m *QueryAllVestingQueueResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllVestingQueueResponse.Merge(m, src) } -func (m *QueryVestingsResponse) XXX_Size() int { +func (m *QueryAllVestingQueueResponse) XXX_Size() int { return m.Size() } -func (m *QueryVestingsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryVestingsResponse.DiscardUnknown(m) +func (m *QueryAllVestingQueueResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllVestingQueueResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryVestingsResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryAllVestingQueueResponse proto.InternalMessageInfo + +func (m *QueryAllVestingQueueResponse) GetVestingQueue() []VestingQueue { + if m != nil { + return m.VestingQueue + } + return nil +} -func (m *QueryVestingsResponse) GetVestings() []VestingQueue { +func (m *QueryAllVestingQueueResponse) GetPagination() *query.PageResponse { if m != nil { - return m.Vestings + return m.Pagination } return nil } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "fundraising.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "fundraising.QueryParamsResponse") - proto.RegisterType((*QueryAuctionsRequest)(nil), "fundraising.QueryAuctionsRequest") - proto.RegisterType((*QueryAuctionsResponse)(nil), "fundraising.QueryAuctionsResponse") - proto.RegisterType((*QueryAuctionRequest)(nil), "fundraising.QueryAuctionRequest") - proto.RegisterType((*QueryAuctionResponse)(nil), "fundraising.QueryAuctionResponse") - proto.RegisterType((*QueryAllowedBidderRequest)(nil), "fundraising.QueryAllowedBidderRequest") - proto.RegisterType((*QueryAllowedBidderResponse)(nil), "fundraising.QueryAllowedBidderResponse") - proto.RegisterType((*QueryAllowedBiddersRequest)(nil), "fundraising.QueryAllowedBiddersRequest") - proto.RegisterType((*QueryAllowedBiddersResponse)(nil), "fundraising.QueryAllowedBiddersResponse") - proto.RegisterType((*QueryBidsRequest)(nil), "fundraising.QueryBidsRequest") - proto.RegisterType((*QueryBidsResponse)(nil), "fundraising.QueryBidsResponse") - proto.RegisterType((*QueryBidRequest)(nil), "fundraising.QueryBidRequest") - proto.RegisterType((*QueryBidResponse)(nil), "fundraising.QueryBidResponse") - proto.RegisterType((*QueryVestingsRequest)(nil), "fundraising.QueryVestingsRequest") - proto.RegisterType((*QueryVestingsResponse)(nil), "fundraising.QueryVestingsResponse") -} - -func init() { proto.RegisterFile("fundraising/query.proto", fileDescriptor_c670d5b855fb1401) } - -var fileDescriptor_c670d5b855fb1401 = []byte{ - // 948 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdd, 0x6b, 0x1c, 0x55, - 0x14, 0xcf, 0x4d, 0xb6, 0x69, 0xf6, 0xc4, 0xa6, 0xf5, 0x36, 0xd1, 0xcd, 0xd8, 0x6c, 0xd3, 0xa1, - 0xa4, 0x21, 0xe8, 0x0c, 0x49, 0xad, 0xf8, 0x11, 0x2a, 0x3b, 0x42, 0xd7, 0x15, 0xc5, 0x76, 0x10, - 0x1f, 0x7c, 0x59, 0xee, 0xec, 0xdc, 0x4e, 0x2f, 0x64, 0x67, 0xb6, 0x7b, 0x67, 0x5a, 0x43, 0x29, - 0x82, 0x22, 0xf8, 0xf1, 0x22, 0x88, 0xef, 0x82, 0xef, 0xa2, 0xd0, 0x3f, 0xa2, 0xf8, 0x54, 0xf0, - 0xc5, 0x27, 0x91, 0xc4, 0x3f, 0xa4, 0xcc, 0xbd, 0x67, 0x36, 0x33, 0x9b, 0xd9, 0xec, 0x26, 0xcd, - 0xdb, 0xdc, 0xf3, 0xf5, 0xfb, 0x9d, 0xdf, 0xb9, 0x7b, 0xee, 0xc2, 0xab, 0x77, 0x93, 0xd0, 0xef, - 0x33, 0x21, 0x45, 0x18, 0xd8, 0xf7, 0x13, 0xde, 0xdf, 0xb5, 0x7a, 0xfd, 0x28, 0x8e, 0xe8, 0x7c, - 0xce, 0x61, 0x6c, 0x74, 0x22, 0xd9, 0x8d, 0xa4, 0xed, 0x31, 0xc9, 0x75, 0x94, 0xfd, 0x60, 0xd3, - 0xe3, 0x31, 0xdb, 0xb4, 0x7b, 0x2c, 0x10, 0x21, 0x8b, 0x45, 0x14, 0xea, 0x44, 0x63, 0x59, 0xc7, - 0xb6, 0xd5, 0xc9, 0xd6, 0x07, 0x74, 0x2d, 0x06, 0x51, 0x10, 0x69, 0x7b, 0xfa, 0x95, 0x25, 0x04, - 0x51, 0x14, 0xec, 0x70, 0x5b, 0x9d, 0xbc, 0xe4, 0xae, 0xcd, 0x42, 0x24, 0x61, 0x5c, 0x42, 0x17, - 0xeb, 0x09, 0x9b, 0x85, 0x61, 0x14, 0x2b, 0xa0, 0xac, 0xdc, 0x4a, 0x9e, 0x7b, 0xee, 0x1b, 0xdd, - 0xb5, 0xbc, 0xbb, 0xc7, 0xfa, 0xac, 0x8b, 0x89, 0xe6, 0x22, 0xd0, 0x3b, 0x69, 0x13, 0xb7, 0x95, - 0xd1, 0xe5, 0xf7, 0x13, 0x2e, 0x63, 0xf3, 0x43, 0xb8, 0x58, 0xb0, 0xca, 0x5e, 0x14, 0x4a, 0x4e, - 0x37, 0x61, 0x56, 0x27, 0xd7, 0xc8, 0x2a, 0x59, 0x9f, 0xdf, 0xba, 0x68, 0xe5, 0xa1, 0x74, 0xb0, - 0x53, 0x79, 0xfa, 0xef, 0xe5, 0x29, 0x17, 0x03, 0xcd, 0x1f, 0x08, 0x2c, 0xaa, 0x52, 0x8d, 0xa4, - 0xa3, 0x08, 0x23, 0x04, 0x7d, 0x05, 0x66, 0x65, 0xcc, 0xe2, 0x44, 0xd7, 0xaa, 0xba, 0x78, 0xa2, - 0x14, 0x2a, 0xf1, 0x6e, 0x8f, 0xd7, 0xa6, 0x95, 0x55, 0x7d, 0xd3, 0x5b, 0x00, 0x07, 0xda, 0xd6, - 0x66, 0x14, 0xf6, 0x9a, 0x85, 0x7a, 0xa6, 0x83, 0xb0, 0xf4, 0xb8, 0x70, 0x10, 0xd6, 0x6d, 0x16, - 0x70, 0xc4, 0x71, 0x73, 0x99, 0xe6, 0xaf, 0x04, 0x96, 0x86, 0xc8, 0x60, 0x67, 0x37, 0x61, 0x8e, - 0xa1, 0xad, 0x46, 0x56, 0x67, 0xd6, 0xe7, 0xb7, 0x16, 0x2d, 0x2d, 0xb8, 0x95, 0xcd, 0xc2, 0x6a, - 0x84, 0xbb, 0xce, 0x4b, 0x7f, 0x3d, 0x79, 0x63, 0x0e, 0xb3, 0x5b, 0xee, 0x20, 0x87, 0x36, 0x0b, - 0x0c, 0xa7, 0x15, 0xc3, 0x6b, 0x63, 0x19, 0x6a, 0xf0, 0x02, 0xc5, 0x37, 0x51, 0x79, 0xc4, 0xc8, - 0xd4, 0x5a, 0x01, 0x40, 0xac, 0xb6, 0xf0, 0x95, 0x62, 0x15, 0xb7, 0x8a, 0x96, 0x96, 0x6f, 0x7e, - 0x56, 0x14, 0x79, 0xd0, 0xd6, 0x36, 0x9c, 0xc5, 0x20, 0x9c, 0xd8, 0x24, 0x5d, 0x65, 0x29, 0xa6, - 0x0b, 0xcb, 0xba, 0xea, 0xce, 0x4e, 0xf4, 0x90, 0xfb, 0x8e, 0xf0, 0x7d, 0xde, 0x9f, 0x8c, 0x51, - 0x3a, 0x5e, 0x4f, 0xc5, 0xe3, 0x20, 0xf1, 0x64, 0x72, 0x30, 0xca, 0x6a, 0x22, 0xdf, 0x26, 0x2c, - 0x30, 0xed, 0x68, 0x63, 0xb6, 0xa6, 0x6d, 0x14, 0x2e, 0x5a, 0x21, 0x17, 0xef, 0xdb, 0x39, 0x96, - 0x37, 0x9a, 0xdf, 0x90, 0x32, 0x1c, 0x39, 0x21, 0xf9, 0x5b, 0x25, 0xd3, 0x3c, 0xc9, 0x7d, 0xfb, - 0x93, 0xc0, 0x6b, 0xa5, 0x2c, 0xb0, 0xdd, 0x16, 0x9c, 0x2f, 0xb6, 0x9b, 0x5d, 0xbe, 0xf1, 0xfd, - 0x2e, 0x14, 0xfa, 0x3d, 0xc5, 0x0b, 0xf8, 0x07, 0x81, 0x0b, 0x8a, 0xb3, 0x23, 0x7c, 0xf9, 0x62, - 0xc3, 0x4e, 0xd3, 0x84, 0x6c, 0x77, 0x59, 0xdc, 0xb9, 0xc7, 0x7d, 0xf5, 0xbb, 0xad, 0xba, 0x55, - 0x21, 0x3f, 0xd1, 0x86, 0x21, 0x99, 0x2b, 0x27, 0x96, 0xf9, 0x3b, 0x02, 0x2f, 0xe7, 0x28, 0xa3, - 0xb8, 0x1b, 0x50, 0xf1, 0x84, 0x9f, 0x29, 0x7a, 0xa1, 0xa0, 0xa8, 0x23, 0x7c, 0xd4, 0x51, 0xc5, - 0x9c, 0x9e, 0x7a, 0x4d, 0x38, 0x9f, 0x31, 0x99, 0x50, 0xbb, 0x25, 0xa5, 0x5d, 0xea, 0x9a, 0x56, - 0xae, 0x33, 0x9e, 0xf0, 0x5b, 0xbe, 0xb9, 0x7d, 0x30, 0x85, 0x41, 0x47, 0xeb, 0x30, 0xe3, 0x61, - 0x89, 0xd1, 0x0d, 0xa5, 0x21, 0xe6, 0x0d, 0xdc, 0x07, 0x9f, 0x73, 0x19, 0x8b, 0x30, 0x90, 0x13, - 0xaf, 0x91, 0xa5, 0xa1, 0x34, 0x44, 0x7e, 0x0f, 0xe6, 0x1e, 0xa0, 0x0d, 0xf5, 0x5c, 0x2e, 0xc0, - 0x63, 0xc2, 0x9d, 0x84, 0x27, 0x1c, 0x79, 0x0c, 0x12, 0xb6, 0x7e, 0xab, 0xc2, 0x19, 0x55, 0x96, - 0x3e, 0x84, 0x59, 0xfd, 0x48, 0xd0, 0xcb, 0x85, 0xf4, 0xc3, 0x2f, 0x90, 0xb1, 0x3a, 0x3a, 0x40, - 0x73, 0x32, 0x37, 0xbe, 0xfe, 0xfb, 0xff, 0x9f, 0xa7, 0xaf, 0x52, 0x13, 0x1f, 0xd6, 0xfc, 0xb3, - 0x97, 0x7b, 0x92, 0x15, 0xdc, 0x57, 0x90, 0xad, 0x37, 0x49, 0xaf, 0x1c, 0xae, 0x3c, 0xf4, 0x36, - 0x19, 0xe6, 0x51, 0x21, 0x08, 0xff, 0xba, 0x82, 0x5f, 0xa3, 0x57, 0x8f, 0x82, 0x1f, 0xbc, 0x0f, - 0xdf, 0x13, 0x38, 0x8b, 0x25, 0xe8, 0xea, 0xc8, 0xea, 0x19, 0xfe, 0x95, 0x23, 0x22, 0x10, 0xfe, - 0x1d, 0x05, 0x7f, 0x9d, 0x6e, 0x4e, 0x02, 0x6f, 0x3f, 0x3a, 0x98, 0xfa, 0x63, 0xfa, 0x84, 0xc0, - 0xb9, 0xc2, 0x4a, 0xa1, 0x6b, 0x25, 0x78, 0x25, 0x3b, 0xdf, 0xb8, 0x36, 0x36, 0x0e, 0xd9, 0xb9, - 0x8a, 0xdd, 0xc7, 0xf4, 0xa3, 0x63, 0xb3, 0xb3, 0x87, 0x16, 0xa2, 0xfd, 0x48, 0x7f, 0x3c, 0xa6, - 0xbf, 0x13, 0x58, 0x28, 0xee, 0x51, 0x3a, 0x8e, 0xcf, 0x60, 0xa0, 0xeb, 0xe3, 0x03, 0x91, 0x79, - 0x4b, 0x31, 0xff, 0x80, 0x36, 0x5e, 0x98, 0x39, 0xfd, 0x96, 0x40, 0x25, 0xdd, 0x48, 0x74, 0xe5, - 0x30, 0x7a, 0x6e, 0xb9, 0x1a, 0xf5, 0x51, 0x6e, 0xa4, 0x74, 0x53, 0x51, 0x7a, 0x9b, 0xbe, 0x75, - 0x7c, 0x4a, 0x6a, 0xb9, 0xfd, 0x48, 0x60, 0xc6, 0x11, 0x3e, 0xbd, 0x54, 0x8a, 0x93, 0xb1, 0x58, - 0x19, 0xe1, 0x45, 0x12, 0x4d, 0x45, 0xa2, 0x41, 0xdf, 0x3f, 0x19, 0x09, 0x35, 0x46, 0x75, 0xfb, - 0x7e, 0x21, 0x30, 0x97, 0xed, 0x97, 0xb2, 0xdf, 0xe2, 0xd0, 0xca, 0x2a, 0xfb, 0x2d, 0x0e, 0xaf, - 0x27, 0xd3, 0x51, 0xe4, 0xb6, 0xe9, 0xbb, 0xc7, 0x27, 0x97, 0x6d, 0x29, 0xe7, 0xd3, 0xa7, 0x7b, - 0x75, 0xf2, 0x6c, 0xaf, 0x4e, 0xfe, 0xdb, 0xab, 0x93, 0x9f, 0xf6, 0xeb, 0x53, 0xcf, 0xf6, 0xeb, - 0x53, 0xff, 0xec, 0xd7, 0xa7, 0xbe, 0xb8, 0x11, 0x88, 0xf8, 0x5e, 0xe2, 0x59, 0x9d, 0xa8, 0x6b, - 0xc7, 0x3c, 0xf4, 0x79, 0xbf, 0x2b, 0xc2, 0xb8, 0x80, 0xf1, 0x65, 0xe1, 0x94, 0xfe, 0x67, 0x95, - 0xde, 0xac, 0xfa, 0x8b, 0x75, 0xfd, 0x79, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6e, 0xf7, 0x61, 0x04, - 0x57, 0x0c, 0x00, 0x00, + proto.RegisterType((*QueryParamsRequest)(nil), "fundraising.fundraising.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "fundraising.fundraising.v1.QueryParamsResponse") + proto.RegisterType((*QueryAllAuctionRequest)(nil), "fundraising.fundraising.v1.QueryAllAuctionRequest") + proto.RegisterType((*QueryAllAuctionResponse)(nil), "fundraising.fundraising.v1.QueryAllAuctionResponse") + proto.RegisterType((*QueryGetAuctionRequest)(nil), "fundraising.fundraising.v1.QueryGetAuctionRequest") + proto.RegisterType((*QueryGetAuctionResponse)(nil), "fundraising.fundraising.v1.QueryGetAuctionResponse") + proto.RegisterType((*QueryAllAllowedBidderRequest)(nil), "fundraising.fundraising.v1.QueryAllAllowedBidderRequest") + proto.RegisterType((*QueryAllAllowedBidderResponse)(nil), "fundraising.fundraising.v1.QueryAllAllowedBidderResponse") + proto.RegisterType((*QueryGetAllowedBidderRequest)(nil), "fundraising.fundraising.v1.QueryGetAllowedBidderRequest") + proto.RegisterType((*QueryGetAllowedBidderResponse)(nil), "fundraising.fundraising.v1.QueryGetAllowedBidderResponse") + proto.RegisterType((*QueryGetBidRequest)(nil), "fundraising.fundraising.v1.QueryGetBidRequest") + proto.RegisterType((*QueryGetBidResponse)(nil), "fundraising.fundraising.v1.QueryGetBidResponse") + proto.RegisterType((*QueryAllBidRequest)(nil), "fundraising.fundraising.v1.QueryAllBidRequest") + proto.RegisterType((*QueryAllBidResponse)(nil), "fundraising.fundraising.v1.QueryAllBidResponse") + proto.RegisterType((*QueryAllVestingQueueRequest)(nil), "fundraising.fundraising.v1.QueryAllVestingQueueRequest") + proto.RegisterType((*QueryAllVestingQueueResponse)(nil), "fundraising.fundraising.v1.QueryAllVestingQueueResponse") +} + +func init() { + proto.RegisterFile("fundraising/fundraising/v1/query.proto", fileDescriptor_8be3ab6819f1d50c) +} + +var fileDescriptor_8be3ab6819f1d50c = []byte{ + // 1023 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0x38, 0xa9, 0x8b, 0x27, 0x01, 0xb5, 0x43, 0x08, 0xa9, 0x69, 0xdd, 0x6a, 0x84, 0xda, + 0x50, 0x94, 0x1d, 0xc5, 0x51, 0x95, 0x80, 0x2a, 0x84, 0x0d, 0xc5, 0x32, 0xa2, 0x34, 0x5d, 0x89, + 0x82, 0x10, 0x92, 0x35, 0x9b, 0x9d, 0x6e, 0x47, 0xb2, 0x77, 0x1d, 0xef, 0xae, 0x4b, 0x54, 0xf5, + 0x82, 0xe0, 0xc6, 0x01, 0xa9, 0x07, 0xae, 0x3d, 0x22, 0x71, 0xa9, 0x10, 0x12, 0x48, 0x5c, 0x38, + 0x56, 0x9c, 0x22, 0x71, 0x81, 0x0b, 0x82, 0x04, 0x89, 0xbf, 0x81, 0x76, 0xe6, 0x2d, 0xd9, 0xb5, + 0xe3, 0xcd, 0xda, 0xb1, 0xb8, 0x24, 0x3b, 0xb3, 0xf3, 0xe6, 0x7d, 0xdf, 0xf7, 0xde, 0xcc, 0xb7, + 0xc6, 0x97, 0xef, 0x86, 0xae, 0xdd, 0xe3, 0xd2, 0x97, 0xae, 0xc3, 0x92, 0xcf, 0xfd, 0x35, 0xb6, + 0x13, 0x8a, 0xde, 0xae, 0xd1, 0xed, 0x79, 0x81, 0x47, 0xca, 0x89, 0x77, 0x46, 0xf2, 0xb9, 0xbf, + 0x56, 0x3e, 0xcb, 0x3b, 0xd2, 0xf5, 0x98, 0xfa, 0xab, 0x97, 0x97, 0xaf, 0x6e, 0x7b, 0x7e, 0xc7, + 0xf3, 0x99, 0xc5, 0x7d, 0xa1, 0xf7, 0x61, 0xfd, 0x35, 0x4b, 0x04, 0x7c, 0x8d, 0x75, 0xb9, 0x23, + 0x5d, 0x1e, 0x48, 0xcf, 0x85, 0xb5, 0xe7, 0xf4, 0xda, 0x96, 0x1a, 0x31, 0x3d, 0x80, 0x57, 0x2c, + 0x03, 0x1d, 0x6f, 0xb7, 0xbd, 0xfb, 0xc2, 0x6e, 0x59, 0xd2, 0xb6, 0x45, 0x0f, 0x02, 0x56, 0xb2, + 0x02, 0xc2, 0xed, 0x44, 0xd6, 0x97, 0x33, 0x56, 0x5a, 0xd2, 0x86, 0x55, 0x57, 0x32, 0x56, 0x75, + 0x79, 0x8f, 0x77, 0x62, 0xa4, 0x46, 0xc6, 0xc2, 0xbe, 0xf0, 0x03, 0xe9, 0x3a, 0xad, 0x9d, 0x50, + 0x84, 0x02, 0xd6, 0x2f, 0x3a, 0x9e, 0xe3, 0x69, 0xc6, 0xd1, 0x13, 0xcc, 0x9e, 0x77, 0x3c, 0xcf, + 0x69, 0x0b, 0xc6, 0xbb, 0x92, 0x71, 0xd7, 0xf5, 0x02, 0xa5, 0x53, 0x9c, 0xe3, 0x1c, 0xbc, 0x55, + 0x23, 0x2b, 0xbc, 0xcb, 0xb8, 0x0b, 0xe5, 0xa1, 0x8b, 0x98, 0xdc, 0x8e, 0x54, 0xde, 0x52, 0x98, + 0x4c, 0xb1, 0x13, 0x0a, 0x3f, 0xa0, 0x9f, 0xe0, 0xe7, 0x53, 0xb3, 0x7e, 0xd7, 0x73, 0x7d, 0x41, + 0x6e, 0xe0, 0xa2, 0xc6, 0xbe, 0x8c, 0x2e, 0xa1, 0x95, 0xf9, 0x2a, 0x35, 0x46, 0x17, 0xd7, 0xd0, + 0xb1, 0xf5, 0xd2, 0xd3, 0x3f, 0x2e, 0xce, 0x7c, 0xf3, 0xcf, 0x93, 0xab, 0xc8, 0x84, 0x60, 0xfa, + 0x25, 0xc2, 0x4b, 0x6a, 0xfb, 0x5a, 0xbb, 0x5d, 0xd3, 0xda, 0x42, 0x62, 0xb2, 0x84, 0x8b, 0x7e, + 0xc0, 0x83, 0x50, 0x67, 0x28, 0x99, 0x30, 0x22, 0x04, 0xcf, 0x05, 0xbb, 0x5d, 0xb1, 0x5c, 0x50, + 0xb3, 0xea, 0x99, 0xbc, 0x83, 0xf1, 0x61, 0x4b, 0x2c, 0xcf, 0x2a, 0x44, 0x97, 0x0d, 0x68, 0x83, + 0xa8, 0x7f, 0x0c, 0xdd, 0x87, 0xd0, 0x3f, 0xc6, 0x16, 0x77, 0x04, 0xe4, 0x31, 0x13, 0x91, 0xf4, + 0x31, 0xc2, 0x2f, 0x0e, 0xc1, 0x01, 0xc6, 0xd7, 0xf1, 0x69, 0xa8, 0xfe, 0x32, 0xba, 0x34, 0xbb, + 0x32, 0x5f, 0x5d, 0x34, 0xb4, 0x96, 0x46, 0xac, 0xa5, 0x51, 0x73, 0x77, 0xeb, 0x0b, 0xbf, 0x7c, + 0xbf, 0xfa, 0x0c, 0xc4, 0x36, 0xcd, 0x38, 0x84, 0x34, 0x52, 0x08, 0x0b, 0x0a, 0xe1, 0x95, 0x63, + 0x11, 0xea, 0xd4, 0x29, 0x88, 0x1b, 0x20, 0x58, 0x43, 0x04, 0x03, 0x82, 0x5d, 0xc0, 0x18, 0xb2, + 0xb5, 0xa4, 0xad, 0x44, 0x9b, 0x33, 0x4b, 0x30, 0xd3, 0xb4, 0xe9, 0x87, 0x40, 0x2d, 0x19, 0x78, + 0x14, 0x35, 0x34, 0x26, 0x35, 0xfa, 0x05, 0xc2, 0xe7, 0xff, 0x13, 0x4d, 0x1f, 0xa8, 0xba, 0x3a, + 0x4f, 0xf9, 0x80, 0x0d, 0x14, 0xaf, 0x30, 0x71, 0xf1, 0x7e, 0x46, 0xf8, 0xc2, 0x08, 0x1c, 0xc0, + 0xf3, 0x0e, 0x7e, 0x2e, 0x7d, 0xe2, 0xa1, 0x92, 0xaf, 0x64, 0x35, 0x6f, 0x6a, 0xab, 0xfa, 0x5c, + 0xd4, 0xc3, 0xe6, 0xb3, 0x3c, 0x39, 0x39, 0xbd, 0xe2, 0x7e, 0x00, 0x4a, 0x46, 0x35, 0x9a, 0x40, + 0xc9, 0x25, 0x5c, 0x04, 0x5e, 0xfa, 0x70, 0xc0, 0x88, 0xde, 0x07, 0x61, 0x86, 0xb7, 0xcd, 0x10, + 0x06, 0x9d, 0x5c, 0x18, 0xfa, 0x2e, 0x5c, 0x29, 0x0d, 0x11, 0xd4, 0xa5, 0x9d, 0x93, 0xc5, 0x0b, + 0x8a, 0x45, 0xf4, 0xaa, 0xa0, 0x5e, 0x9d, 0xb2, 0xa4, 0xdd, 0xb4, 0xe9, 0xfb, 0x70, 0x11, 0xc5, + 0x7b, 0x01, 0xf4, 0x0d, 0x3c, 0x6b, 0xc1, 0x2e, 0xf3, 0xd5, 0x8b, 0x59, 0x78, 0xeb, 0xd2, 0x06, + 0x94, 0x51, 0x04, 0xfd, 0x0e, 0x01, 0xb8, 0x5a, 0xbb, 0x9d, 0x1f, 0xdc, 0x08, 0x89, 0xa3, 0x30, + 0xe9, 0xb7, 0x3a, 0x3c, 0xd8, 0xbe, 0x27, 0x6c, 0x75, 0x03, 0x95, 0xcc, 0x92, 0xf4, 0x6f, 0xea, + 0x89, 0x81, 0x1e, 0x9f, 0x9b, 0xb8, 0xc7, 0xbf, 0x46, 0xa0, 0x42, 0x0c, 0x7a, 0x50, 0x85, 0xd9, + 0xf1, 0x54, 0x98, 0x5e, 0xeb, 0x7e, 0x8e, 0xf0, 0x4b, 0x31, 0xb2, 0x3b, 0xda, 0xac, 0x6e, 0x47, + 0x5e, 0xf5, 0x3f, 0x5f, 0x02, 0x3f, 0x25, 0x2e, 0xa3, 0x34, 0x0c, 0x50, 0xca, 0xc4, 0x0b, 0xfd, + 0xc4, 0x3c, 0x48, 0xb6, 0x92, 0x25, 0x59, 0x72, 0x1f, 0xd0, 0x2e, 0xb5, 0xc7, 0xd4, 0x44, 0xac, + 0x3e, 0x5a, 0xc0, 0xa7, 0x14, 0x7a, 0xf2, 0x18, 0xe1, 0xa2, 0xb6, 0x4d, 0x62, 0x64, 0x61, 0x1b, + 0x76, 0xec, 0x32, 0xcb, 0xbd, 0x5e, 0x23, 0xa0, 0xd7, 0x3e, 0xfb, 0xf5, 0xef, 0x47, 0x05, 0x46, + 0x56, 0x59, 0x20, 0x5c, 0x5b, 0xf4, 0x3a, 0xd2, 0x0d, 0xd8, 0xb1, 0x1f, 0x2d, 0xe4, 0x5b, 0x84, + 0xe7, 0xdf, 0x93, 0x7e, 0xec, 0x26, 0xa4, 0x7a, 0x6c, 0xde, 0x21, 0x93, 0x2f, 0xaf, 0x8f, 0x15, + 0x03, 0x78, 0xd7, 0x15, 0xde, 0x55, 0xf2, 0x6a, 0x1e, 0xbc, 0xb1, 0x01, 0xff, 0x80, 0x30, 0x3e, + 0xb4, 0xbe, 0x1c, 0x60, 0x87, 0x0c, 0x36, 0x07, 0xd8, 0x61, 0x6f, 0xa5, 0x6f, 0x2a, 0xb0, 0xaf, + 0x93, 0xcd, 0x31, 0xc0, 0xb2, 0x07, 0x87, 0x47, 0xe5, 0x21, 0xf9, 0x1d, 0xe1, 0xb3, 0x4a, 0xe7, + 0x94, 0xe7, 0x6c, 0xe6, 0x52, 0xee, 0x08, 0x13, 0x29, 0xbf, 0x36, 0x41, 0x24, 0x90, 0xb9, 0xa5, + 0xc8, 0x34, 0x49, 0x63, 0x52, 0x32, 0x03, 0x5f, 0xdc, 0xe4, 0x2f, 0x84, 0xcf, 0x0c, 0xba, 0x52, + 0x0e, 0x6a, 0x23, 0xfc, 0x31, 0x07, 0xb5, 0x51, 0x16, 0x48, 0x3f, 0x52, 0xd4, 0x4c, 0xb2, 0x35, + 0x25, 0x6a, 0xec, 0x81, 0xfe, 0xff, 0x90, 0x3c, 0x41, 0xf8, 0x74, 0x54, 0xbf, 0xba, 0xb4, 0x73, + 0x9c, 0xe5, 0x94, 0x1b, 0xe5, 0x38, 0xcb, 0x69, 0x23, 0xa0, 0x6f, 0x2b, 0x1a, 0x6f, 0x90, 0xeb, + 0x13, 0xd3, 0x88, 0x5c, 0xe1, 0x47, 0x84, 0x8b, 0xda, 0x67, 0x73, 0x20, 0x4e, 0x99, 0x7b, 0x0e, + 0xc4, 0x69, 0x03, 0xa7, 0x37, 0x15, 0xe2, 0x06, 0xb9, 0x71, 0x12, 0xc4, 0x4a, 0x6d, 0x75, 0x5a, + 0xf6, 0x10, 0x3e, 0x13, 0xa9, 0x9d, 0xbc, 0xb4, 0xc9, 0x46, 0x1e, 0x19, 0x8f, 0x70, 0xad, 0xf2, + 0xe6, 0xf8, 0x81, 0x40, 0xab, 0xa9, 0x68, 0xbd, 0x45, 0x6a, 0x13, 0xd3, 0x02, 0x8b, 0xf1, 0xeb, + 0xb7, 0x9e, 0xee, 0x57, 0xd0, 0xde, 0x7e, 0x05, 0xfd, 0xb9, 0x5f, 0x41, 0x5f, 0x1d, 0x54, 0x66, + 0xf6, 0x0e, 0x2a, 0x33, 0xbf, 0x1d, 0x54, 0x66, 0x3e, 0xbe, 0xe6, 0xc8, 0xe0, 0x5e, 0x68, 0x19, + 0xdb, 0x5e, 0x67, 0x54, 0x9a, 0x4f, 0x53, 0xa3, 0xe8, 0xd7, 0x92, 0x6f, 0x15, 0xd5, 0x67, 0xfd, + 0xfa, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xbb, 0xf4, 0xe8, 0xe1, 0xb9, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -941,22 +962,19 @@ 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 returns parameters of the fundraising module. + // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Auctions returns all auctions. - Auctions(ctx context.Context, in *QueryAuctionsRequest, opts ...grpc.CallOption) (*QueryAuctionsResponse, error) - // Auction returns the specific auction. - Auction(ctx context.Context, in *QueryAuctionRequest, opts ...grpc.CallOption) (*QueryAuctionResponse, error) - // AllowedBidder returns the specific allowed bidder information. - AllowedBidder(ctx context.Context, in *QueryAllowedBidderRequest, opts ...grpc.CallOption) (*QueryAllowedBidderResponse, error) - // AllowedBidders returns all allowed bidders for the auction. - AllowedBidders(ctx context.Context, in *QueryAllowedBiddersRequest, opts ...grpc.CallOption) (*QueryAllowedBiddersResponse, error) - // Bids returns all bids. - Bids(ctx context.Context, in *QueryBidsRequest, opts ...grpc.CallOption) (*QueryBidsResponse, error) - // Bid returns the specific bid from the auction id and bid id. - Bid(ctx context.Context, in *QueryBidRequest, opts ...grpc.CallOption) (*QueryBidResponse, error) - // Vestings returns all vestings for the auction. - Vestings(ctx context.Context, in *QueryVestingsRequest, opts ...grpc.CallOption) (*QueryVestingsResponse, error) + // Queries a list of Auction items. + ListAuction(ctx context.Context, in *QueryAllAuctionRequest, opts ...grpc.CallOption) (*QueryAllAuctionResponse, error) + GetAuction(ctx context.Context, in *QueryGetAuctionRequest, opts ...grpc.CallOption) (*QueryGetAuctionResponse, error) + // Queries a list of AllowedBidder items. + ListAllowedBidder(ctx context.Context, in *QueryAllAllowedBidderRequest, opts ...grpc.CallOption) (*QueryAllAllowedBidderResponse, error) + GetAllowedBidder(ctx context.Context, in *QueryGetAllowedBidderRequest, opts ...grpc.CallOption) (*QueryGetAllowedBidderResponse, error) + // Queries a list of Bid items. + ListBid(ctx context.Context, in *QueryAllBidRequest, opts ...grpc.CallOption) (*QueryAllBidResponse, error) + GetBid(ctx context.Context, in *QueryGetBidRequest, opts ...grpc.CallOption) (*QueryGetBidResponse, error) + // Queries a list of VestingQueue items. + ListVestingQueue(ctx context.Context, in *QueryAllVestingQueueRequest, opts ...grpc.CallOption) (*QueryAllVestingQueueResponse, error) } type queryClient struct { @@ -969,70 +987,70 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/fundraising.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/fundraising.fundraising.v1.Query/Params", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) Auctions(ctx context.Context, in *QueryAuctionsRequest, opts ...grpc.CallOption) (*QueryAuctionsResponse, error) { - out := new(QueryAuctionsResponse) - err := c.cc.Invoke(ctx, "/fundraising.Query/Auctions", in, out, opts...) +func (c *queryClient) ListAuction(ctx context.Context, in *QueryAllAuctionRequest, opts ...grpc.CallOption) (*QueryAllAuctionResponse, error) { + out := new(QueryAllAuctionResponse) + err := c.cc.Invoke(ctx, "/fundraising.fundraising.v1.Query/ListAuction", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) Auction(ctx context.Context, in *QueryAuctionRequest, opts ...grpc.CallOption) (*QueryAuctionResponse, error) { - out := new(QueryAuctionResponse) - err := c.cc.Invoke(ctx, "/fundraising.Query/Auction", in, out, opts...) +func (c *queryClient) GetAuction(ctx context.Context, in *QueryGetAuctionRequest, opts ...grpc.CallOption) (*QueryGetAuctionResponse, error) { + out := new(QueryGetAuctionResponse) + err := c.cc.Invoke(ctx, "/fundraising.fundraising.v1.Query/GetAuction", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) AllowedBidder(ctx context.Context, in *QueryAllowedBidderRequest, opts ...grpc.CallOption) (*QueryAllowedBidderResponse, error) { - out := new(QueryAllowedBidderResponse) - err := c.cc.Invoke(ctx, "/fundraising.Query/AllowedBidder", in, out, opts...) +func (c *queryClient) ListAllowedBidder(ctx context.Context, in *QueryAllAllowedBidderRequest, opts ...grpc.CallOption) (*QueryAllAllowedBidderResponse, error) { + out := new(QueryAllAllowedBidderResponse) + err := c.cc.Invoke(ctx, "/fundraising.fundraising.v1.Query/ListAllowedBidder", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) AllowedBidders(ctx context.Context, in *QueryAllowedBiddersRequest, opts ...grpc.CallOption) (*QueryAllowedBiddersResponse, error) { - out := new(QueryAllowedBiddersResponse) - err := c.cc.Invoke(ctx, "/fundraising.Query/AllowedBidders", in, out, opts...) +func (c *queryClient) GetAllowedBidder(ctx context.Context, in *QueryGetAllowedBidderRequest, opts ...grpc.CallOption) (*QueryGetAllowedBidderResponse, error) { + out := new(QueryGetAllowedBidderResponse) + err := c.cc.Invoke(ctx, "/fundraising.fundraising.v1.Query/GetAllowedBidder", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) Bids(ctx context.Context, in *QueryBidsRequest, opts ...grpc.CallOption) (*QueryBidsResponse, error) { - out := new(QueryBidsResponse) - err := c.cc.Invoke(ctx, "/fundraising.Query/Bids", in, out, opts...) +func (c *queryClient) ListBid(ctx context.Context, in *QueryAllBidRequest, opts ...grpc.CallOption) (*QueryAllBidResponse, error) { + out := new(QueryAllBidResponse) + err := c.cc.Invoke(ctx, "/fundraising.fundraising.v1.Query/ListBid", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) Bid(ctx context.Context, in *QueryBidRequest, opts ...grpc.CallOption) (*QueryBidResponse, error) { - out := new(QueryBidResponse) - err := c.cc.Invoke(ctx, "/fundraising.Query/Bid", in, out, opts...) +func (c *queryClient) GetBid(ctx context.Context, in *QueryGetBidRequest, opts ...grpc.CallOption) (*QueryGetBidResponse, error) { + out := new(QueryGetBidResponse) + err := c.cc.Invoke(ctx, "/fundraising.fundraising.v1.Query/GetBid", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) Vestings(ctx context.Context, in *QueryVestingsRequest, opts ...grpc.CallOption) (*QueryVestingsResponse, error) { - out := new(QueryVestingsResponse) - err := c.cc.Invoke(ctx, "/fundraising.Query/Vestings", in, out, opts...) +func (c *queryClient) ListVestingQueue(ctx context.Context, in *QueryAllVestingQueueRequest, opts ...grpc.CallOption) (*QueryAllVestingQueueResponse, error) { + out := new(QueryAllVestingQueueResponse) + err := c.cc.Invoke(ctx, "/fundraising.fundraising.v1.Query/ListVestingQueue", in, out, opts...) if err != nil { return nil, err } @@ -1041,22 +1059,19 @@ func (c *queryClient) Vestings(ctx context.Context, in *QueryVestingsRequest, op // QueryServer is the server API for Query service. type QueryServer interface { - // Params returns parameters of the fundraising module. + // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Auctions returns all auctions. - Auctions(context.Context, *QueryAuctionsRequest) (*QueryAuctionsResponse, error) - // Auction returns the specific auction. - Auction(context.Context, *QueryAuctionRequest) (*QueryAuctionResponse, error) - // AllowedBidder returns the specific allowed bidder information. - AllowedBidder(context.Context, *QueryAllowedBidderRequest) (*QueryAllowedBidderResponse, error) - // AllowedBidders returns all allowed bidders for the auction. - AllowedBidders(context.Context, *QueryAllowedBiddersRequest) (*QueryAllowedBiddersResponse, error) - // Bids returns all bids. - Bids(context.Context, *QueryBidsRequest) (*QueryBidsResponse, error) - // Bid returns the specific bid from the auction id and bid id. - Bid(context.Context, *QueryBidRequest) (*QueryBidResponse, error) - // Vestings returns all vestings for the auction. - Vestings(context.Context, *QueryVestingsRequest) (*QueryVestingsResponse, error) + // Queries a list of Auction items. + ListAuction(context.Context, *QueryAllAuctionRequest) (*QueryAllAuctionResponse, error) + GetAuction(context.Context, *QueryGetAuctionRequest) (*QueryGetAuctionResponse, error) + // Queries a list of AllowedBidder items. + ListAllowedBidder(context.Context, *QueryAllAllowedBidderRequest) (*QueryAllAllowedBidderResponse, error) + GetAllowedBidder(context.Context, *QueryGetAllowedBidderRequest) (*QueryGetAllowedBidderResponse, error) + // Queries a list of Bid items. + ListBid(context.Context, *QueryAllBidRequest) (*QueryAllBidResponse, error) + GetBid(context.Context, *QueryGetBidRequest) (*QueryGetBidResponse, error) + // Queries a list of VestingQueue items. + ListVestingQueue(context.Context, *QueryAllVestingQueueRequest) (*QueryAllVestingQueueResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1066,26 +1081,26 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (*UnimplementedQueryServer) Auctions(ctx context.Context, req *QueryAuctionsRequest) (*QueryAuctionsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Auctions not implemented") +func (*UnimplementedQueryServer) ListAuction(ctx context.Context, req *QueryAllAuctionRequest) (*QueryAllAuctionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAuction not implemented") } -func (*UnimplementedQueryServer) Auction(ctx context.Context, req *QueryAuctionRequest) (*QueryAuctionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Auction not implemented") +func (*UnimplementedQueryServer) GetAuction(ctx context.Context, req *QueryGetAuctionRequest) (*QueryGetAuctionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAuction not implemented") } -func (*UnimplementedQueryServer) AllowedBidder(ctx context.Context, req *QueryAllowedBidderRequest) (*QueryAllowedBidderResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllowedBidder not implemented") +func (*UnimplementedQueryServer) ListAllowedBidder(ctx context.Context, req *QueryAllAllowedBidderRequest) (*QueryAllAllowedBidderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAllowedBidder not implemented") } -func (*UnimplementedQueryServer) AllowedBidders(ctx context.Context, req *QueryAllowedBiddersRequest) (*QueryAllowedBiddersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllowedBidders not implemented") +func (*UnimplementedQueryServer) GetAllowedBidder(ctx context.Context, req *QueryGetAllowedBidderRequest) (*QueryGetAllowedBidderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAllowedBidder not implemented") } -func (*UnimplementedQueryServer) Bids(ctx context.Context, req *QueryBidsRequest) (*QueryBidsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Bids not implemented") +func (*UnimplementedQueryServer) ListBid(ctx context.Context, req *QueryAllBidRequest) (*QueryAllBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListBid not implemented") } -func (*UnimplementedQueryServer) Bid(ctx context.Context, req *QueryBidRequest) (*QueryBidResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Bid not implemented") +func (*UnimplementedQueryServer) GetBid(ctx context.Context, req *QueryGetBidRequest) (*QueryGetBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBid not implemented") } -func (*UnimplementedQueryServer) Vestings(ctx context.Context, req *QueryVestingsRequest) (*QueryVestingsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Vestings not implemented") +func (*UnimplementedQueryServer) ListVestingQueue(ctx context.Context, req *QueryAllVestingQueueRequest) (*QueryAllVestingQueueResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListVestingQueue not implemented") } func RegisterQueryServer(s grpc1.Server, srv QueryServer) { @@ -1102,7 +1117,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/fundraising.Query/Params", + FullMethod: "/fundraising.fundraising.v1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -1110,134 +1125,134 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_Auctions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAuctionsRequest) +func _Query_ListAuction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllAuctionRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).Auctions(ctx, in) + return srv.(QueryServer).ListAuction(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/fundraising.Query/Auctions", + FullMethod: "/fundraising.fundraising.v1.Query/ListAuction", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Auctions(ctx, req.(*QueryAuctionsRequest)) + return srv.(QueryServer).ListAuction(ctx, req.(*QueryAllAuctionRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_Auction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAuctionRequest) +func _Query_GetAuction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetAuctionRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).Auction(ctx, in) + return srv.(QueryServer).GetAuction(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/fundraising.Query/Auction", + FullMethod: "/fundraising.fundraising.v1.Query/GetAuction", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Auction(ctx, req.(*QueryAuctionRequest)) + return srv.(QueryServer).GetAuction(ctx, req.(*QueryGetAuctionRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_AllowedBidder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllowedBidderRequest) +func _Query_ListAllowedBidder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllAllowedBidderRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).AllowedBidder(ctx, in) + return srv.(QueryServer).ListAllowedBidder(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/fundraising.Query/AllowedBidder", + FullMethod: "/fundraising.fundraising.v1.Query/ListAllowedBidder", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllowedBidder(ctx, req.(*QueryAllowedBidderRequest)) + return srv.(QueryServer).ListAllowedBidder(ctx, req.(*QueryAllAllowedBidderRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_AllowedBidders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllowedBiddersRequest) +func _Query_GetAllowedBidder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetAllowedBidderRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).AllowedBidders(ctx, in) + return srv.(QueryServer).GetAllowedBidder(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/fundraising.Query/AllowedBidders", + FullMethod: "/fundraising.fundraising.v1.Query/GetAllowedBidder", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllowedBidders(ctx, req.(*QueryAllowedBiddersRequest)) + return srv.(QueryServer).GetAllowedBidder(ctx, req.(*QueryGetAllowedBidderRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_Bids_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryBidsRequest) +func _Query_ListBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllBidRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).Bids(ctx, in) + return srv.(QueryServer).ListBid(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/fundraising.Query/Bids", + FullMethod: "/fundraising.fundraising.v1.Query/ListBid", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Bids(ctx, req.(*QueryBidsRequest)) + return srv.(QueryServer).ListBid(ctx, req.(*QueryAllBidRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_Bid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryBidRequest) +func _Query_GetBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetBidRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).Bid(ctx, in) + return srv.(QueryServer).GetBid(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/fundraising.Query/Bid", + FullMethod: "/fundraising.fundraising.v1.Query/GetBid", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Bid(ctx, req.(*QueryBidRequest)) + return srv.(QueryServer).GetBid(ctx, req.(*QueryGetBidRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_Vestings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryVestingsRequest) +func _Query_ListVestingQueue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllVestingQueueRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).Vestings(ctx, in) + return srv.(QueryServer).ListVestingQueue(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/fundraising.Query/Vestings", + FullMethod: "/fundraising.fundraising.v1.Query/ListVestingQueue", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Vestings(ctx, req.(*QueryVestingsRequest)) + return srv.(QueryServer).ListVestingQueue(ctx, req.(*QueryAllVestingQueueRequest)) } return interceptor(ctx, in, info, handler) } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "fundraising.Query", + ServiceName: "fundraising.fundraising.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -1245,36 +1260,36 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_Params_Handler, }, { - MethodName: "Auctions", - Handler: _Query_Auctions_Handler, + MethodName: "ListAuction", + Handler: _Query_ListAuction_Handler, }, { - MethodName: "Auction", - Handler: _Query_Auction_Handler, + MethodName: "GetAuction", + Handler: _Query_GetAuction_Handler, }, { - MethodName: "AllowedBidder", - Handler: _Query_AllowedBidder_Handler, + MethodName: "ListAllowedBidder", + Handler: _Query_ListAllowedBidder_Handler, }, { - MethodName: "AllowedBidders", - Handler: _Query_AllowedBidders_Handler, + MethodName: "GetAllowedBidder", + Handler: _Query_GetAllowedBidder_Handler, }, { - MethodName: "Bids", - Handler: _Query_Bids_Handler, + MethodName: "ListBid", + Handler: _Query_ListBid_Handler, }, { - MethodName: "Bid", - Handler: _Query_Bid_Handler, + MethodName: "GetBid", + Handler: _Query_GetBid_Handler, }, { - MethodName: "Vestings", - Handler: _Query_Vestings_Handler, + MethodName: "ListVestingQueue", + Handler: _Query_ListVestingQueue_Handler, }, }, Streams: []grpc.StreamDesc{}, - Metadata: "fundraising/query.proto", + Metadata: "fundraising/fundraising/v1/query.proto", } func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { @@ -1333,7 +1348,7 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAuctionsRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllAuctionRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1343,12 +1358,12 @@ func (m *QueryAuctionsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAuctionsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllAuctionRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAuctionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllAuctionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1382,7 +1397,7 @@ func (m *QueryAuctionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAuctionsResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAllAuctionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1392,12 +1407,12 @@ func (m *QueryAuctionsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAuctionsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllAuctionResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAuctionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllAuctionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1414,10 +1429,10 @@ func (m *QueryAuctionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.Auctions) > 0 { - for iNdEx := len(m.Auctions) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Auction) > 0 { + for iNdEx := len(m.Auction) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Auctions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Auction[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1431,7 +1446,7 @@ func (m *QueryAuctionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAuctionRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryGetAuctionRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1441,12 +1456,12 @@ func (m *QueryAuctionRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAuctionRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetAuctionRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAuctionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetAuctionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1459,7 +1474,7 @@ func (m *QueryAuctionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAuctionResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryGetAuctionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1469,12 +1484,12 @@ func (m *QueryAuctionResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAuctionResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetAuctionResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAuctionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetAuctionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1494,75 +1509,7 @@ func (m *QueryAuctionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAllowedBidderRequest) 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 *QueryAllowedBidderRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllowedBidderRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0x12 - } - if m.AuctionId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryAllowedBidderResponse) 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 *QueryAllowedBidderResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllowedBidderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.AllowedBidder.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 *QueryAllowedBiddersRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllAllowedBidderRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1572,12 +1519,12 @@ func (m *QueryAllowedBiddersRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllowedBiddersRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllAllowedBidderRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllowedBiddersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllAllowedBidderRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1602,7 +1549,7 @@ func (m *QueryAllowedBiddersRequest) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *QueryAllowedBiddersResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAllAllowedBidderResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1612,12 +1559,12 @@ func (m *QueryAllowedBiddersResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllowedBiddersResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllAllowedBidderResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllowedBiddersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllAllowedBidderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1634,10 +1581,10 @@ func (m *QueryAllowedBiddersResponse) MarshalToSizedBuffer(dAtA []byte) (int, er i-- dAtA[i] = 0x12 } - if len(m.AllowedBidders) > 0 { - for iNdEx := len(m.AllowedBidders) - 1; iNdEx >= 0; iNdEx-- { + if len(m.AllowedBidder) > 0 { + for iNdEx := len(m.AllowedBidder) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.AllowedBidders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.AllowedBidder[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1651,7 +1598,7 @@ func (m *QueryAllowedBiddersResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } -func (m *QueryBidsRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryGetAllowedBidderRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1661,35 +1608,16 @@ func (m *QueryBidsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryBidsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetAllowedBidderRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryBidsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetAllowedBidderRequest) 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] = 0x22 - } - if len(m.IsMatched) > 0 { - i -= len(m.IsMatched) - copy(dAtA[i:], m.IsMatched) - i = encodeVarintQuery(dAtA, i, uint64(len(m.IsMatched))) - i-- - dAtA[i] = 0x1a - } if len(m.Bidder) > 0 { i -= len(m.Bidder) copy(dAtA[i:], m.Bidder) @@ -1705,7 +1633,7 @@ func (m *QueryBidsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryBidsResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryGetAllowedBidderResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1715,46 +1643,30 @@ func (m *QueryBidsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryBidsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetAllowedBidderResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryBidsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetAllowedBidderResponse) 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.Bids) > 0 { - for iNdEx := len(m.Bids) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Bids[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa + { + size, err := m.AllowedBidder.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 *QueryBidRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryGetBidRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1764,12 +1676,12 @@ func (m *QueryBidRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryBidRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetBidRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1787,7 +1699,7 @@ func (m *QueryBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryBidResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryGetBidResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1797,12 +1709,12 @@ func (m *QueryBidResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryBidResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetBidResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1820,7 +1732,7 @@ func (m *QueryBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryVestingsRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllBidRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1830,25 +1742,140 @@ func (m *QueryVestingsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryVestingsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllBidRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryVestingsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.AuctionId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x8 - } + 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] = 0x22 + } + if len(m.IsMatched) > 0 { + i -= len(m.IsMatched) + copy(dAtA[i:], m.IsMatched) + i = encodeVarintQuery(dAtA, i, uint64(len(m.IsMatched))) + i-- + dAtA[i] = 0x1a + } + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x12 + } + if m.AuctionId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryAllBidResponse) 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 *QueryAllBidResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllBidResponse) 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.Bid) > 0 { + for iNdEx := len(m.Bid) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Bid[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 *QueryAllVestingQueueRequest) 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 *QueryAllVestingQueueRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllVestingQueueRequest) 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 m.AuctionId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } -func (m *QueryVestingsResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAllVestingQueueResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1858,20 +1885,32 @@ func (m *QueryVestingsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryVestingsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllVestingQueueResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryVestingsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllVestingQueueResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Vestings) > 0 { - for iNdEx := len(m.Vestings) - 1; iNdEx >= 0; iNdEx-- { + 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.VestingQueue) > 0 { + for iNdEx := len(m.VestingQueue) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Vestings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.VestingQueue[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1916,7 +1955,7 @@ func (m *QueryParamsResponse) Size() (n int) { return n } -func (m *QueryAuctionsRequest) Size() (n int) { +func (m *QueryAllAuctionRequest) Size() (n int) { if m == nil { return 0 } @@ -1937,14 +1976,14 @@ func (m *QueryAuctionsRequest) Size() (n int) { return n } -func (m *QueryAuctionsResponse) Size() (n int) { +func (m *QueryAllAuctionResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Auctions) > 0 { - for _, e := range m.Auctions { + if len(m.Auction) > 0 { + for _, e := range m.Auction { l = e.Size() n += 1 + l + sovQuery(uint64(l)) } @@ -1956,7 +1995,7 @@ func (m *QueryAuctionsResponse) Size() (n int) { return n } -func (m *QueryAuctionRequest) Size() (n int) { +func (m *QueryGetAuctionRequest) Size() (n int) { if m == nil { return 0 } @@ -1968,7 +2007,7 @@ func (m *QueryAuctionRequest) Size() (n int) { return n } -func (m *QueryAuctionResponse) Size() (n int) { +func (m *QueryGetAuctionResponse) Size() (n int) { if m == nil { return 0 } @@ -1981,7 +2020,42 @@ func (m *QueryAuctionResponse) Size() (n int) { return n } -func (m *QueryAllowedBidderRequest) Size() (n int) { +func (m *QueryAllAllowedBidderRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovQuery(uint64(m.AuctionId)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllAllowedBidderResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AllowedBidder) > 0 { + for _, e := range m.AllowedBidder { + 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 *QueryGetAllowedBidderRequest) Size() (n int) { if m == nil { return 0 } @@ -1997,7 +2071,7 @@ func (m *QueryAllowedBidderRequest) Size() (n int) { return n } -func (m *QueryAllowedBidderResponse) Size() (n int) { +func (m *QueryGetAllowedBidderResponse) Size() (n int) { if m == nil { return 0 } @@ -2008,7 +2082,7 @@ func (m *QueryAllowedBidderResponse) Size() (n int) { return n } -func (m *QueryAllowedBiddersRequest) Size() (n int) { +func (m *QueryGetBidRequest) Size() (n int) { if m == nil { return 0 } @@ -2017,33 +2091,24 @@ func (m *QueryAllowedBiddersRequest) Size() (n int) { if m.AuctionId != 0 { n += 1 + sovQuery(uint64(m.AuctionId)) } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.BidId != 0 { + n += 1 + sovQuery(uint64(m.BidId)) } return n } -func (m *QueryAllowedBiddersResponse) Size() (n int) { +func (m *QueryGetBidResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.AllowedBidders) > 0 { - for _, e := range m.AllowedBidders { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } + l = m.Bid.Size() + n += 1 + l + sovQuery(uint64(l)) return n } -func (m *QueryBidsRequest) Size() (n int) { +func (m *QueryAllBidRequest) Size() (n int) { if m == nil { return 0 } @@ -2067,14 +2132,14 @@ func (m *QueryBidsRequest) Size() (n int) { return n } -func (m *QueryBidsResponse) Size() (n int) { +func (m *QueryAllBidResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Bids) > 0 { - for _, e := range m.Bids { + if len(m.Bid) > 0 { + for _, e := range m.Bid { l = e.Size() n += 1 + l + sovQuery(uint64(l)) } @@ -2086,7 +2151,7 @@ func (m *QueryBidsResponse) Size() (n int) { return n } -func (m *QueryBidRequest) Size() (n int) { +func (m *QueryAllVestingQueueRequest) Size() (n int) { if m == nil { return 0 } @@ -2095,47 +2160,29 @@ func (m *QueryBidRequest) Size() (n int) { if m.AuctionId != 0 { n += 1 + sovQuery(uint64(m.AuctionId)) } - if m.BidId != 0 { - n += 1 + sovQuery(uint64(m.BidId)) - } - return n -} - -func (m *QueryBidResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Bid.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryVestingsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AuctionId != 0 { - n += 1 + sovQuery(uint64(m.AuctionId)) + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) } return n } -func (m *QueryVestingsResponse) Size() (n int) { +func (m *QueryAllVestingQueueResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Vestings) > 0 { - for _, e := range m.Vestings { + if len(m.VestingQueue) > 0 { + for _, e := range m.VestingQueue { 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 } @@ -2278,7 +2325,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAuctionsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllAuctionRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2301,10 +2348,10 @@ func (m *QueryAuctionsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAuctionsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllAuctionRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAuctionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllAuctionRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2428,7 +2475,7 @@ func (m *QueryAuctionsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAuctionsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllAuctionResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2451,15 +2498,15 @@ func (m *QueryAuctionsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAuctionsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllAuctionResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAuctionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllAuctionResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Auctions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Auction", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2486,8 +2533,8 @@ func (m *QueryAuctionsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Auctions = append(m.Auctions, &types.Any{}) - if err := m.Auctions[len(m.Auctions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Auction = append(m.Auction, &types.Any{}) + if err := m.Auction[len(m.Auction)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2548,7 +2595,7 @@ func (m *QueryAuctionsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAuctionRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetAuctionRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2571,10 +2618,10 @@ func (m *QueryAuctionRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAuctionRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetAuctionRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAuctionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetAuctionRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2617,7 +2664,7 @@ func (m *QueryAuctionRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAuctionResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetAuctionResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2640,10 +2687,10 @@ func (m *QueryAuctionResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAuctionResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetAuctionResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAuctionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetAuctionResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2703,7 +2750,7 @@ func (m *QueryAuctionResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllowedBidderRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllAllowedBidderRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2726,10 +2773,10 @@ func (m *QueryAllowedBidderRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllowedBidderRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllAllowedBidderRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllowedBidderRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllAllowedBidderRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2753,9 +2800,9 @@ func (m *QueryAllowedBidderRequest) Unmarshal(dAtA []byte) error { } case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2765,23 +2812,27 @@ func (m *QueryAllowedBidderRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.Bidder = string(dAtA[iNdEx:postIndex]) + 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 @@ -2804,7 +2855,7 @@ func (m *QueryAllowedBidderRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllowedBidderResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllAllowedBidderResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2827,10 +2878,10 @@ func (m *QueryAllowedBidderResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllowedBidderResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllAllowedBidderResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllowedBidderResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllAllowedBidderResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2862,7 +2913,44 @@ func (m *QueryAllowedBidderResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AllowedBidder.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.AllowedBidder = append(m.AllowedBidder, AllowedBidder{}) + if err := m.AllowedBidder[len(m.AllowedBidder)-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 @@ -2887,7 +2975,7 @@ func (m *QueryAllowedBidderResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllowedBiddersRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetAllowedBidderRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2910,10 +2998,10 @@ func (m *QueryAllowedBiddersRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllowedBiddersRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetAllowedBidderRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllowedBiddersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetAllowedBidderRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2937,9 +3025,9 @@ func (m *QueryAllowedBiddersRequest) Unmarshal(dAtA []byte) error { } case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2949,27 +3037,23 @@ func (m *QueryAllowedBiddersRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen 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 - } + m.Bidder = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2992,7 +3076,7 @@ func (m *QueryAllowedBiddersRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllowedBiddersResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetAllowedBidderResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3015,15 +3099,15 @@ func (m *QueryAllowedBiddersResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllowedBiddersResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetAllowedBidderResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllowedBiddersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetAllowedBidderResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowedBidders", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AllowedBidder", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3050,14 +3134,151 @@ func (m *QueryAllowedBiddersResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AllowedBidders = append(m.AllowedBidders, AllowedBidder{}) - if err := m.AllowedBidders[len(m.AllowedBidders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.AllowedBidder.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 *QueryGetBidRequest) 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: QueryGetBidRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetBidRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BidId", wireType) + } + m.BidId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BidId |= uint64(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 (m *QueryGetBidResponse) 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: QueryGetBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Bid", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3084,10 +3305,7 @@ func (m *QueryAllowedBiddersResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Bid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3112,7 +3330,7 @@ func (m *QueryAllowedBiddersResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryBidsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllBidRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3135,10 +3353,10 @@ func (m *QueryBidsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryBidsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllBidRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryBidsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllBidRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3281,7 +3499,7 @@ func (m *QueryBidsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryBidsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllBidResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3304,15 +3522,15 @@ func (m *QueryBidsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryBidsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllBidResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryBidsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bids", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Bid", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3339,8 +3557,8 @@ func (m *QueryBidsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Bids = append(m.Bids, Bid{}) - if err := m.Bids[len(m.Bids)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Bid = append(m.Bid, Bid{}) + if err := m.Bid[len(m.Bid)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3401,7 +3619,7 @@ func (m *QueryBidsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryBidRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllVestingQueueRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3424,10 +3642,10 @@ func (m *QueryBidRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryBidRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllVestingQueueRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryBidRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllVestingQueueRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3450,77 +3668,8 @@ func (m *QueryBidRequest) Unmarshal(dAtA []byte) error { } } case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BidId", wireType) - } - m.BidId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BidId |= uint64(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 (m *QueryBidResponse) 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: QueryBidResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bid", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3547,7 +3696,10 @@ func (m *QueryBidResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Bid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3572,7 +3724,7 @@ func (m *QueryBidResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryVestingsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllVestingQueueResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3595,17 +3747,17 @@ func (m *QueryVestingsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryVestingsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllVestingQueueResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVestingsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllVestingQueueResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VestingQueue", wireType) } - m.AuctionId = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3615,64 +3767,29 @@ func (m *QueryVestingsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift + msglen |= int(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 { + if msglen < 0 { return ErrInvalidLengthQuery } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryVestingsResponse) 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 + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.VestingQueue = append(m.VestingQueue, VestingQueue{}) + if err := m.VestingQueue[len(m.VestingQueue)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryVestingsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVestingsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Vestings", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3699,8 +3816,10 @@ func (m *QueryVestingsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Vestings = append(m.Vestings, VestingQueue{}) - if err := m.Vestings[len(m.Vestings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/fundraising/types/query.pb.gw.go b/x/fundraising/types/query.pb.gw.go index 8f3e32b3..8217b60a 100644 --- a/x/fundraising/types/query.pb.gw.go +++ b/x/fundraising/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: fundraising/query.proto +// source: fundraising/fundraising/v1/query.proto /* Package types is a reverse proxy. @@ -52,43 +52,43 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } var ( - filter_Query_Auctions_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_Query_ListAuction_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -func request_Query_Auctions_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAuctionsRequest +func request_Query_ListAuction_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllAuctionRequest 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_Auctions_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListAuction_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Auctions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.ListAuction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_Auctions_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAuctionsRequest +func local_request_Query_ListAuction_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllAuctionRequest 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_Auctions_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListAuction_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Auctions(ctx, &protoReq) + msg, err := server.ListAuction(ctx, &protoReq) return msg, metadata, err } -func request_Query_Auction_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAuctionRequest +func request_Query_GetAuction_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetAuctionRequest var metadata runtime.ServerMetadata var ( @@ -109,13 +109,13 @@ func request_Query_Auction_0(ctx context.Context, marshaler runtime.Marshaler, c return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) } - msg, err := client.Auction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetAuction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_Auction_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAuctionRequest +func local_request_Query_GetAuction_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetAuctionRequest var metadata runtime.ServerMetadata var ( @@ -136,13 +136,17 @@ func local_request_Query_Auction_0(ctx context.Context, marshaler runtime.Marsha return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) } - msg, err := server.Auction(ctx, &protoReq) + msg, err := server.GetAuction(ctx, &protoReq) return msg, metadata, err } -func request_Query_AllowedBidder_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllowedBidderRequest +var ( + filter_Query_ListAllowedBidder_0 = &utilities.DoubleArray{Encoding: map[string]int{"auction_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_ListAllowedBidder_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllAllowedBidderRequest var metadata runtime.ServerMetadata var ( @@ -163,24 +167,20 @@ func request_Query_AllowedBidder_0(ctx context.Context, marshaler runtime.Marsha return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) } - val, ok = pathParams["bidder"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Bidder, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListAllowedBidder_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.AllowedBidder(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.ListAllowedBidder(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_AllowedBidder_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllowedBidderRequest +func local_request_Query_ListAllowedBidder_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllAllowedBidderRequest var metadata runtime.ServerMetadata var ( @@ -201,28 +201,20 @@ func local_request_Query_AllowedBidder_0(ctx context.Context, marshaler runtime. return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) } - val, ok = pathParams["bidder"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Bidder, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListAllowedBidder_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.AllowedBidder(ctx, &protoReq) + msg, err := server.ListAllowedBidder(ctx, &protoReq) return msg, metadata, err } -var ( - filter_Query_AllowedBidders_0 = &utilities.DoubleArray{Encoding: map[string]int{"auction_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_AllowedBidders_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllowedBiddersRequest +func request_Query_GetAllowedBidder_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetAllowedBidderRequest var metadata runtime.ServerMetadata var ( @@ -243,20 +235,24 @@ func request_Query_AllowedBidders_0(ctx context.Context, marshaler runtime.Marsh return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllowedBidders_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) } - msg, err := client.AllowedBidders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetAllowedBidder(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_AllowedBidders_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllowedBiddersRequest +func local_request_Query_GetAllowedBidder_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetAllowedBidderRequest var metadata runtime.ServerMetadata var ( @@ -277,24 +273,28 @@ func local_request_Query_AllowedBidders_0(ctx context.Context, marshaler runtime return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllowedBidders_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) } - msg, err := server.AllowedBidders(ctx, &protoReq) + msg, err := server.GetAllowedBidder(ctx, &protoReq) return msg, metadata, err } var ( - filter_Query_Bids_0 = &utilities.DoubleArray{Encoding: map[string]int{"auction_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} + filter_Query_ListBid_0 = &utilities.DoubleArray{Encoding: map[string]int{"auction_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) -func request_Query_Bids_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryBidsRequest +func request_Query_ListBid_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllBidRequest var metadata runtime.ServerMetadata var ( @@ -318,17 +318,17 @@ func request_Query_Bids_0(ctx context.Context, marshaler runtime.Marshaler, clie if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Bids_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListBid_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Bids(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.ListBid(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_Bids_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryBidsRequest +func local_request_Query_ListBid_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllBidRequest var metadata runtime.ServerMetadata var ( @@ -352,17 +352,17 @@ func local_request_Query_Bids_0(ctx context.Context, marshaler runtime.Marshaler if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Bids_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListBid_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Bids(ctx, &protoReq) + msg, err := server.ListBid(ctx, &protoReq) return msg, metadata, err } -func request_Query_Bid_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryBidRequest +func request_Query_GetBid_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetBidRequest var metadata runtime.ServerMetadata var ( @@ -394,13 +394,13 @@ func request_Query_Bid_0(ctx context.Context, marshaler runtime.Marshaler, clien return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bid_id", err) } - msg, err := client.Bid(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetBid(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_Bid_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryBidRequest +func local_request_Query_GetBid_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetBidRequest var metadata runtime.ServerMetadata var ( @@ -432,13 +432,17 @@ func local_request_Query_Bid_0(ctx context.Context, marshaler runtime.Marshaler, return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bid_id", err) } - msg, err := server.Bid(ctx, &protoReq) + msg, err := server.GetBid(ctx, &protoReq) return msg, metadata, err } -func request_Query_Vestings_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVestingsRequest +var ( + filter_Query_ListVestingQueue_0 = &utilities.DoubleArray{Encoding: map[string]int{"auction_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_ListVestingQueue_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllVestingQueueRequest var metadata runtime.ServerMetadata var ( @@ -459,13 +463,20 @@ func request_Query_Vestings_0(ctx context.Context, marshaler runtime.Marshaler, return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) } - msg, err := client.Vestings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListVestingQueue_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListVestingQueue(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_Vestings_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVestingsRequest +func local_request_Query_ListVestingQueue_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllVestingQueueRequest var metadata runtime.ServerMetadata var ( @@ -486,7 +497,14 @@ func local_request_Query_Vestings_0(ctx context.Context, marshaler runtime.Marsh return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) } - msg, err := server.Vestings(ctx, &protoReq) + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListVestingQueue_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListVestingQueue(ctx, &protoReq) return msg, metadata, err } @@ -520,7 +538,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_Auctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ListAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -531,7 +549,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_Auctions_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_ListAuction_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 { @@ -539,11 +557,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_Auctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ListAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_Auction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -554,7 +572,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_Auction_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_GetAuction_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 { @@ -562,11 +580,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_Auction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_AllowedBidder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ListAllowedBidder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -577,7 +595,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_AllowedBidder_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_ListAllowedBidder_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 { @@ -585,11 +603,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_AllowedBidder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ListAllowedBidder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_AllowedBidders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetAllowedBidder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -600,7 +618,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_AllowedBidders_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_GetAllowedBidder_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 { @@ -608,11 +626,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_AllowedBidders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetAllowedBidder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_Bids_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ListBid_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -623,7 +641,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_Bids_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_ListBid_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 { @@ -631,11 +649,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_Bids_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ListBid_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_Bid_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetBid_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -646,7 +664,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_Bid_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_GetBid_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 { @@ -654,11 +672,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_Bid_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetBid_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_Vestings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ListVestingQueue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -669,7 +687,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_Vestings_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_ListVestingQueue_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 { @@ -677,7 +695,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_Vestings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ListVestingQueue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -742,7 +760,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_Auctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ListAuction_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) @@ -751,18 +769,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_Auctions_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_ListAuction_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_Auctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ListAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_Auction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetAuction_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) @@ -771,18 +789,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_Auction_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_GetAuction_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_Auction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_AllowedBidder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ListAllowedBidder_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) @@ -791,18 +809,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_AllowedBidder_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_ListAllowedBidder_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_AllowedBidder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ListAllowedBidder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_AllowedBidders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetAllowedBidder_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) @@ -811,18 +829,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_AllowedBidders_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_GetAllowedBidder_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_AllowedBidders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetAllowedBidder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_Bids_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ListBid_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) @@ -831,18 +849,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_Bids_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_ListBid_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_Bids_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ListBid_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_Bid_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetBid_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) @@ -851,18 +869,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_Bid_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_GetBid_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_Bid_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetBid_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_Vestings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ListVestingQueue_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) @@ -871,14 +889,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_Vestings_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_ListVestingQueue_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_Vestings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ListVestingQueue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -886,37 +904,37 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "fundraising", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 2, 3}, []string{"tendermint", "fundraising", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Auctions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "fundraising", "v1beta1", "auctions"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ListAuction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"tendermint", "fundraising", "auction"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Auction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "fundraising", "v1beta1", "auctions", "auction_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GetAuction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"tendermint", "fundraising", "auction", "auction_id"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_AllowedBidder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "fundraising", "v1beta1", "auctions", "auction_id", "allowed_bidders", "bidder"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ListAllowedBidder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"tendermint", "fundraising", "auction", "auction_id", "allowed_bidder"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_AllowedBidders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "fundraising", "v1beta1", "auctions", "auction_id", "allowed_bidders"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GetAllowedBidder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"tendermint", "fundraising", "auction", "auction_id", "allowed_bidder", "bidder"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Bids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "fundraising", "v1beta1", "auctions", "auction_id", "bids"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ListBid_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"tendermint", "fundraising", "auction", "auction_id", "bid"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Bid_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "fundraising", "v1beta1", "auctions", "auction_id", "bids", "bid_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GetBid_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"tendermint", "fundraising", "auction", "auction_id", "bid", "bid_id"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Vestings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "fundraising", "v1beta1", "auctions", "auction_id", "vestings"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ListVestingQueue_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"tendermint", "fundraising", "auction", "auction_id", "vestings"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage - forward_Query_Auctions_0 = runtime.ForwardResponseMessage + forward_Query_ListAuction_0 = runtime.ForwardResponseMessage - forward_Query_Auction_0 = runtime.ForwardResponseMessage + forward_Query_GetAuction_0 = runtime.ForwardResponseMessage - forward_Query_AllowedBidder_0 = runtime.ForwardResponseMessage + forward_Query_ListAllowedBidder_0 = runtime.ForwardResponseMessage - forward_Query_AllowedBidders_0 = runtime.ForwardResponseMessage + forward_Query_GetAllowedBidder_0 = runtime.ForwardResponseMessage - forward_Query_Bids_0 = runtime.ForwardResponseMessage + forward_Query_ListBid_0 = runtime.ForwardResponseMessage - forward_Query_Bid_0 = runtime.ForwardResponseMessage + forward_Query_GetBid_0 = runtime.ForwardResponseMessage - forward_Query_Vestings_0 = runtime.ForwardResponseMessage + forward_Query_ListVestingQueue_0 = runtime.ForwardResponseMessage ) diff --git a/x/fundraising/types/tx.pb.go b/x/fundraising/types/tx.pb.go index 0eff7556..bac1df54 100644 --- a/x/fundraising/types/tx.pb.go +++ b/x/fundraising/types/tx.pb.go @@ -1,13 +1,16 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: fundraising/tx.proto +// source: fundraising/fundraising/v1/tx.proto 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" 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" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -34,13 +37,106 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_bd48063046df62e0, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bd48063046df62e0, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + // MsgCreateFixedPriceAuction defines a SDK message for creating a fixed price // auction. type MsgCreateFixedPriceAuction struct { // auctioneer specifies the bech32-encoded address that creates the auction Auctioneer string `protobuf:"bytes,1,opt,name=auctioneer,proto3" json:"auctioneer,omitempty"` // start_price specifies the starting price of the auction - StartPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=start_price,json=startPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"start_price"` + StartPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=start_price,json=startPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"start_price"` // selling_coin specifies the selling coin for the auction SellingCoin types.Coin `protobuf:"bytes,3,opt,name=selling_coin,json=sellingCoin,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"selling_coin"` // paying_coin_denom specifies the paying coin denom that bidders use to bid @@ -58,7 +154,7 @@ func (m *MsgCreateFixedPriceAuction) Reset() { *m = MsgCreateFixedPriceA func (m *MsgCreateFixedPriceAuction) String() string { return proto.CompactTextString(m) } func (*MsgCreateFixedPriceAuction) ProtoMessage() {} func (*MsgCreateFixedPriceAuction) Descriptor() ([]byte, []int) { - return fileDescriptor_f041af45fa02962b, []int{0} + return fileDescriptor_bd48063046df62e0, []int{2} } func (m *MsgCreateFixedPriceAuction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -87,6 +183,48 @@ func (m *MsgCreateFixedPriceAuction) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCreateFixedPriceAuction proto.InternalMessageInfo +func (m *MsgCreateFixedPriceAuction) GetAuctioneer() string { + if m != nil { + return m.Auctioneer + } + return "" +} + +func (m *MsgCreateFixedPriceAuction) GetSellingCoin() types.Coin { + if m != nil { + return m.SellingCoin + } + return types.Coin{} +} + +func (m *MsgCreateFixedPriceAuction) GetPayingCoinDenom() string { + if m != nil { + return m.PayingCoinDenom + } + return "" +} + +func (m *MsgCreateFixedPriceAuction) GetVestingSchedules() []VestingSchedule { + if m != nil { + return m.VestingSchedules + } + return nil +} + +func (m *MsgCreateFixedPriceAuction) GetStartTime() time.Time { + if m != nil { + return m.StartTime + } + return time.Time{} +} + +func (m *MsgCreateFixedPriceAuction) GetEndTime() time.Time { + if m != nil { + return m.EndTime + } + return time.Time{} +} + // MsgCreateFixedPriceAuctionResponse defines the // Msg/MsgCreateFixedPriceAuctionResponse response type. type MsgCreateFixedPriceAuctionResponse struct { @@ -96,7 +234,7 @@ func (m *MsgCreateFixedPriceAuctionResponse) Reset() { *m = MsgCreateFix func (m *MsgCreateFixedPriceAuctionResponse) String() string { return proto.CompactTextString(m) } func (*MsgCreateFixedPriceAuctionResponse) ProtoMessage() {} func (*MsgCreateFixedPriceAuctionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f041af45fa02962b, []int{1} + return fileDescriptor_bd48063046df62e0, []int{3} } func (m *MsgCreateFixedPriceAuctionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -134,9 +272,9 @@ type MsgCreateBatchAuction struct { // auctioneer specifies the bech32-encoded address that creates the auction Auctioneer string `protobuf:"bytes,1,opt,name=auctioneer,proto3" json:"auctioneer,omitempty"` // start_price specifies the starting price of the auction - StartPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=start_price,json=startPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"start_price"` + StartPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=start_price,json=startPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"start_price"` // min_bid_price specifies the minibum bid price - MinBidPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=min_bid_price,json=minBidPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_bid_price"` + MinBidPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=min_bid_price,json=minBidPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_bid_price"` // selling_coin specifies the selling coin for the auction SellingCoin types.Coin `protobuf:"bytes,4,opt,name=selling_coin,json=sellingCoin,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"selling_coin"` // paying_coin_denom specifies the paying coin denom that bidders use to bid @@ -149,7 +287,7 @@ type MsgCreateBatchAuction struct { MaxExtendedRound uint32 `protobuf:"varint,7,opt,name=max_extended_round,json=maxExtendedRound,proto3" json:"max_extended_round,omitempty"` // extended_round_rate specifies the rate that decides if the auction needs // another round - ExtendedRoundRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=extended_round_rate,json=extendedRoundRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"extended_round_rate"` + ExtendedRoundRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=extended_round_rate,json=extendedRoundRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"extended_round_rate"` // start_time specifies the start time of the plan StartTime time.Time `protobuf:"bytes,9,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"` // end_time specifies the end time of the plan @@ -160,7 +298,7 @@ func (m *MsgCreateBatchAuction) Reset() { *m = MsgCreateBatchAuction{} } func (m *MsgCreateBatchAuction) String() string { return proto.CompactTextString(m) } func (*MsgCreateBatchAuction) ProtoMessage() {} func (*MsgCreateBatchAuction) Descriptor() ([]byte, []int) { - return fileDescriptor_f041af45fa02962b, []int{2} + return fileDescriptor_bd48063046df62e0, []int{4} } func (m *MsgCreateBatchAuction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -189,6 +327,55 @@ func (m *MsgCreateBatchAuction) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCreateBatchAuction proto.InternalMessageInfo +func (m *MsgCreateBatchAuction) GetAuctioneer() string { + if m != nil { + return m.Auctioneer + } + return "" +} + +func (m *MsgCreateBatchAuction) GetSellingCoin() types.Coin { + if m != nil { + return m.SellingCoin + } + return types.Coin{} +} + +func (m *MsgCreateBatchAuction) GetPayingCoinDenom() string { + if m != nil { + return m.PayingCoinDenom + } + return "" +} + +func (m *MsgCreateBatchAuction) GetVestingSchedules() []VestingSchedule { + if m != nil { + return m.VestingSchedules + } + return nil +} + +func (m *MsgCreateBatchAuction) GetMaxExtendedRound() uint32 { + if m != nil { + return m.MaxExtendedRound + } + return 0 +} + +func (m *MsgCreateBatchAuction) GetStartTime() time.Time { + if m != nil { + return m.StartTime + } + return time.Time{} +} + +func (m *MsgCreateBatchAuction) GetEndTime() time.Time { + if m != nil { + return m.EndTime + } + return time.Time{} +} + // MsgCreateBatchAuctionResponse defines the // Msg/MsgCreateBatchAuctionResponse response type. type MsgCreateBatchAuctionResponse struct { @@ -198,7 +385,7 @@ func (m *MsgCreateBatchAuctionResponse) Reset() { *m = MsgCreateBatchAuc func (m *MsgCreateBatchAuctionResponse) String() string { return proto.CompactTextString(m) } func (*MsgCreateBatchAuctionResponse) ProtoMessage() {} func (*MsgCreateBatchAuctionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f041af45fa02962b, []int{3} + return fileDescriptor_bd48063046df62e0, []int{5} } func (m *MsgCreateBatchAuctionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -241,7 +428,7 @@ func (m *MsgCancelAuction) Reset() { *m = MsgCancelAuction{} } func (m *MsgCancelAuction) String() string { return proto.CompactTextString(m) } func (*MsgCancelAuction) ProtoMessage() {} func (*MsgCancelAuction) Descriptor() ([]byte, []int) { - return fileDescriptor_f041af45fa02962b, []int{4} + return fileDescriptor_bd48063046df62e0, []int{6} } func (m *MsgCancelAuction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -270,6 +457,20 @@ func (m *MsgCancelAuction) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCancelAuction proto.InternalMessageInfo +func (m *MsgCancelAuction) GetAuctioneer() string { + if m != nil { + return m.Auctioneer + } + return "" +} + +func (m *MsgCancelAuction) GetAuctionId() uint64 { + if m != nil { + return m.AuctionId + } + return 0 +} + // MsgCancelAuctionResponse defines the Msg/MsgCancelAuctionResponse // response type. type MsgCancelAuctionResponse struct { @@ -279,7 +480,7 @@ func (m *MsgCancelAuctionResponse) Reset() { *m = MsgCancelAuctionRespon func (m *MsgCancelAuctionResponse) String() string { return proto.CompactTextString(m) } func (*MsgCancelAuctionResponse) ProtoMessage() {} func (*MsgCancelAuctionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f041af45fa02962b, []int{5} + return fileDescriptor_bd48063046df62e0, []int{7} } func (m *MsgCancelAuctionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -316,11 +517,11 @@ type MsgPlaceBid struct { Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` // type specifies the bid type; type 1 is fixed price, 2 is how-much-worth, 3 // is how-many-coins - BidType BidType `protobuf:"varint,3,opt,name=bid_type,json=bidType,proto3,enum=fundraising.BidType" json:"bid_type,omitempty"` + BidType BidType `protobuf:"varint,3,opt,name=bid_type,json=bidType,proto3,enum=fundraising.fundraising.v1.BidType" json:"bid_type,omitempty"` // price specifies the bid price. // The bid price must be the start price for fixed price auction whereas // the bide price can be any value that the bidder places. - Price github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=price,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"price"` + Price cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=price,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"price"` // coin specifies the paying amount of coin or the selling amount that the // bidder bids Coin types.Coin `protobuf:"bytes,5,opt,name=coin,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"coin"` @@ -330,7 +531,7 @@ func (m *MsgPlaceBid) Reset() { *m = MsgPlaceBid{} } func (m *MsgPlaceBid) String() string { return proto.CompactTextString(m) } func (*MsgPlaceBid) ProtoMessage() {} func (*MsgPlaceBid) Descriptor() ([]byte, []int) { - return fileDescriptor_f041af45fa02962b, []int{6} + return fileDescriptor_bd48063046df62e0, []int{8} } func (m *MsgPlaceBid) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -359,6 +560,34 @@ func (m *MsgPlaceBid) XXX_DiscardUnknown() { var xxx_messageInfo_MsgPlaceBid proto.InternalMessageInfo +func (m *MsgPlaceBid) GetAuctionId() uint64 { + if m != nil { + return m.AuctionId + } + return 0 +} + +func (m *MsgPlaceBid) GetBidder() string { + if m != nil { + return m.Bidder + } + return "" +} + +func (m *MsgPlaceBid) GetBidType() BidType { + if m != nil { + return m.BidType + } + return BidTypeNil +} + +func (m *MsgPlaceBid) GetCoin() types.Coin { + if m != nil { + return m.Coin + } + return types.Coin{} +} + // MsgPlaceBidResponse defines the Msg/MsgPlaceBidResponse response type. type MsgPlaceBidResponse struct { } @@ -367,7 +596,7 @@ func (m *MsgPlaceBidResponse) Reset() { *m = MsgPlaceBidResponse{} } func (m *MsgPlaceBidResponse) String() string { return proto.CompactTextString(m) } func (*MsgPlaceBidResponse) ProtoMessage() {} func (*MsgPlaceBidResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f041af45fa02962b, []int{7} + return fileDescriptor_bd48063046df62e0, []int{9} } func (m *MsgPlaceBidResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -408,7 +637,7 @@ type MsgModifyBid struct { // price specifies the bid price. // the bide price must be above or equal to the original value that the bidder // placed. - Price github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=price,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"price"` + Price cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=price,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"price"` // coin specifies the paying amount of coin or the selling amount that the // bidder bids Coin types.Coin `protobuf:"bytes,5,opt,name=coin,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"coin"` @@ -418,7 +647,7 @@ func (m *MsgModifyBid) Reset() { *m = MsgModifyBid{} } func (m *MsgModifyBid) String() string { return proto.CompactTextString(m) } func (*MsgModifyBid) ProtoMessage() {} func (*MsgModifyBid) Descriptor() ([]byte, []int) { - return fileDescriptor_f041af45fa02962b, []int{8} + return fileDescriptor_bd48063046df62e0, []int{10} } func (m *MsgModifyBid) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -447,6 +676,34 @@ func (m *MsgModifyBid) XXX_DiscardUnknown() { var xxx_messageInfo_MsgModifyBid proto.InternalMessageInfo +func (m *MsgModifyBid) GetAuctionId() uint64 { + if m != nil { + return m.AuctionId + } + return 0 +} + +func (m *MsgModifyBid) GetBidder() string { + if m != nil { + return m.Bidder + } + return "" +} + +func (m *MsgModifyBid) GetBidId() uint64 { + if m != nil { + return m.BidId + } + return 0 +} + +func (m *MsgModifyBid) GetCoin() types.Coin { + if m != nil { + return m.Coin + } + return types.Coin{} +} + // MsgModifyBidResponse defines the Msg/MsgModifyBidResponse response type. type MsgModifyBidResponse struct { } @@ -455,7 +712,7 @@ func (m *MsgModifyBidResponse) Reset() { *m = MsgModifyBidResponse{} } func (m *MsgModifyBidResponse) String() string { return proto.CompactTextString(m) } func (*MsgModifyBidResponse) ProtoMessage() {} func (*MsgModifyBidResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f041af45fa02962b, []int{9} + return fileDescriptor_bd48063046df62e0, []int{11} } func (m *MsgModifyBidResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -498,7 +755,7 @@ func (m *MsgAddAllowedBidder) Reset() { *m = MsgAddAllowedBidder{} } func (m *MsgAddAllowedBidder) String() string { return proto.CompactTextString(m) } func (*MsgAddAllowedBidder) ProtoMessage() {} func (*MsgAddAllowedBidder) Descriptor() ([]byte, []int) { - return fileDescriptor_f041af45fa02962b, []int{10} + return fileDescriptor_bd48063046df62e0, []int{12} } func (m *MsgAddAllowedBidder) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -527,6 +784,21 @@ func (m *MsgAddAllowedBidder) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAddAllowedBidder proto.InternalMessageInfo +func (m *MsgAddAllowedBidder) GetAuctionId() uint64 { + if m != nil { + return m.AuctionId + } + return 0 +} + +func (m *MsgAddAllowedBidder) GetAllowedBidder() AllowedBidder { + if m != nil { + return m.AllowedBidder + } + return AllowedBidder{} +} + +// MsgAddAllowedBidderResponse defines the Msg/MsgAddAllowedBidderResponse response type. type MsgAddAllowedBidderResponse struct { } @@ -534,7 +806,7 @@ func (m *MsgAddAllowedBidderResponse) Reset() { *m = MsgAddAllowedBidder func (m *MsgAddAllowedBidderResponse) String() string { return proto.CompactTextString(m) } func (*MsgAddAllowedBidderResponse) ProtoMessage() {} func (*MsgAddAllowedBidderResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f041af45fa02962b, []int{11} + return fileDescriptor_bd48063046df62e0, []int{13} } func (m *MsgAddAllowedBidderResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -564,81 +836,101 @@ func (m *MsgAddAllowedBidderResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAddAllowedBidderResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgCreateFixedPriceAuction)(nil), "fundraising.MsgCreateFixedPriceAuction") - proto.RegisterType((*MsgCreateFixedPriceAuctionResponse)(nil), "fundraising.MsgCreateFixedPriceAuctionResponse") - proto.RegisterType((*MsgCreateBatchAuction)(nil), "fundraising.MsgCreateBatchAuction") - proto.RegisterType((*MsgCreateBatchAuctionResponse)(nil), "fundraising.MsgCreateBatchAuctionResponse") - proto.RegisterType((*MsgCancelAuction)(nil), "fundraising.MsgCancelAuction") - proto.RegisterType((*MsgCancelAuctionResponse)(nil), "fundraising.MsgCancelAuctionResponse") - proto.RegisterType((*MsgPlaceBid)(nil), "fundraising.MsgPlaceBid") - proto.RegisterType((*MsgPlaceBidResponse)(nil), "fundraising.MsgPlaceBidResponse") - proto.RegisterType((*MsgModifyBid)(nil), "fundraising.MsgModifyBid") - proto.RegisterType((*MsgModifyBidResponse)(nil), "fundraising.MsgModifyBidResponse") - proto.RegisterType((*MsgAddAllowedBidder)(nil), "fundraising.MsgAddAllowedBidder") - proto.RegisterType((*MsgAddAllowedBidderResponse)(nil), "fundraising.MsgAddAllowedBidderResponse") -} - -func init() { proto.RegisterFile("fundraising/tx.proto", fileDescriptor_f041af45fa02962b) } - -var fileDescriptor_f041af45fa02962b = []byte{ - // 908 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x41, 0x6f, 0xe3, 0x44, - 0x14, 0x8e, 0x1b, 0xa7, 0x4d, 0x5e, 0xb6, 0x4b, 0xeb, 0x6d, 0x17, 0xaf, 0x21, 0x49, 0x89, 0x80, - 0xad, 0x56, 0x60, 0x6b, 0x8b, 0xb8, 0x70, 0x41, 0x75, 0xcb, 0xa2, 0x1e, 0xa2, 0xae, 0xcc, 0x02, - 0x12, 0x87, 0x5a, 0x63, 0xcf, 0xd4, 0x1d, 0x11, 0x7b, 0x22, 0xcf, 0xa4, 0xa4, 0x67, 0x84, 0xb4, - 0xc7, 0xfd, 0x09, 0x70, 0xdd, 0x5f, 0xb2, 0xc7, 0x3d, 0x22, 0x0e, 0xbb, 0xa8, 0xfd, 0x23, 0x68, - 0xc6, 0x8e, 0x71, 0xd2, 0x84, 0x76, 0x53, 0xa4, 0xd5, 0x9e, 0x32, 0x7e, 0xef, 0x7b, 0xdf, 0x9b, - 0xf9, 0xe6, 0x7d, 0x76, 0x60, 0xe3, 0x78, 0x98, 0xe0, 0x14, 0x51, 0x4e, 0x93, 0xc8, 0x11, 0x23, - 0x7b, 0x90, 0x32, 0xc1, 0x8c, 0x66, 0x29, 0x6a, 0xb5, 0x43, 0xc6, 0x63, 0xc6, 0x9d, 0x00, 0x71, - 0xe2, 0x9c, 0x3e, 0x0c, 0x88, 0x40, 0x0f, 0x9d, 0x90, 0xd1, 0x24, 0x03, 0x5b, 0x1b, 0x11, 0x8b, - 0x98, 0x5a, 0x3a, 0x72, 0x95, 0x47, 0x3b, 0x11, 0x63, 0x51, 0x9f, 0x38, 0xea, 0x29, 0x18, 0x1e, - 0x3b, 0x82, 0xc6, 0x84, 0x0b, 0x14, 0x0f, 0x72, 0x40, 0xab, 0xdc, 0xb9, 0xb4, 0xce, 0xd2, 0xdd, - 0xdf, 0x74, 0xb0, 0x7a, 0x3c, 0xda, 0x4b, 0x09, 0x12, 0xe4, 0x11, 0x1d, 0x11, 0xfc, 0x38, 0xa5, - 0x21, 0xd9, 0x1d, 0x86, 0x82, 0xb2, 0xc4, 0x68, 0x03, 0xa0, 0x6c, 0x49, 0x48, 0x6a, 0x6a, 0x5b, - 0xda, 0x76, 0xc3, 0x2b, 0x45, 0x8c, 0x43, 0x68, 0x72, 0x81, 0x52, 0xe1, 0x0f, 0x64, 0x95, 0xb9, - 0x24, 0x01, 0xae, 0xfd, 0xe2, 0x55, 0xa7, 0xf2, 0xd7, 0xab, 0xce, 0xa7, 0x11, 0x15, 0x27, 0xc3, - 0xc0, 0x0e, 0x59, 0xec, 0xe4, 0x87, 0xcb, 0x7e, 0x3e, 0xe7, 0xf8, 0x67, 0x47, 0x9c, 0x0d, 0x08, - 0xb7, 0xf7, 0x49, 0xe8, 0x81, 0xa2, 0x50, 0x7d, 0x8d, 0x18, 0x6e, 0x71, 0xd2, 0xef, 0xd3, 0x24, - 0xf2, 0xe5, 0xd9, 0xcd, 0xea, 0x96, 0xb6, 0xdd, 0xdc, 0xb9, 0x67, 0x67, 0x85, 0xb6, 0x14, 0xc7, - 0xce, 0xc5, 0xb1, 0xf7, 0x18, 0x4d, 0x5c, 0x47, 0x36, 0x7b, 0xfe, 0xba, 0x73, 0xff, 0x1a, 0xcd, - 0x64, 0x81, 0xd7, 0xcc, 0xf9, 0xe5, 0x83, 0xf1, 0x00, 0xd6, 0x07, 0xe8, 0x6c, 0xdc, 0xcd, 0xc7, - 0x24, 0x61, 0xb1, 0xa9, 0xab, 0x63, 0xbe, 0x97, 0x25, 0x24, 0x6c, 0x5f, 0x86, 0x8d, 0x43, 0x58, - 0x3f, 0x25, 0x5c, 0x48, 0x30, 0x0f, 0x4f, 0x08, 0x1e, 0xf6, 0x09, 0x37, 0x6b, 0x5b, 0xd5, 0xed, - 0xe6, 0xce, 0x87, 0x76, 0x59, 0xd9, 0x1f, 0x32, 0xd4, 0x77, 0x39, 0xc8, 0xd5, 0xe5, 0x16, 0xbd, - 0xb5, 0xd3, 0xc9, 0x30, 0x37, 0xf6, 0x20, 0x3b, 0xb9, 0x2f, 0xef, 0xcc, 0x5c, 0x56, 0x27, 0xb5, - 0xec, 0xec, 0x42, 0xed, 0xf1, 0x85, 0xda, 0x4f, 0xc6, 0x17, 0xea, 0xd6, 0x25, 0xcf, 0xb3, 0xd7, - 0x1d, 0xcd, 0x6b, 0xa8, 0x3a, 0x99, 0x31, 0xbe, 0x86, 0x3a, 0x49, 0x70, 0x46, 0xb1, 0xf2, 0x06, - 0x14, 0x2b, 0x24, 0xc1, 0x32, 0xfe, 0x95, 0xfe, 0xf4, 0xf7, 0x4e, 0xa5, 0xfb, 0x31, 0x74, 0xe7, - 0x8f, 0x81, 0x47, 0xf8, 0x80, 0x25, 0x9c, 0x74, 0xcf, 0x6b, 0xb0, 0x59, 0xc0, 0x5c, 0x24, 0xc2, - 0x93, 0xb7, 0x36, 0x28, 0x1e, 0xac, 0xc6, 0x34, 0xf1, 0x03, 0x8a, 0x73, 0xca, 0xea, 0x42, 0x94, - 0xcd, 0x98, 0x26, 0x2e, 0xc5, 0xb3, 0x87, 0x4f, 0x7f, 0x0b, 0xc3, 0x57, 0x7b, 0x83, 0xe1, 0x5b, - 0xbe, 0xc1, 0xf0, 0x7d, 0x06, 0x46, 0x8c, 0x46, 0x3e, 0x19, 0x09, 0x92, 0x60, 0x82, 0xfd, 0x94, - 0x0d, 0x13, 0xac, 0x26, 0x68, 0xd5, 0x5b, 0x8b, 0xd1, 0xe8, 0x9b, 0x3c, 0xe1, 0xc9, 0xb8, 0x71, - 0x04, 0x77, 0x26, 0x91, 0x7e, 0x8a, 0x04, 0x31, 0xeb, 0x0b, 0x69, 0xbe, 0x4e, 0xca, 0xdc, 0x1e, - 0x12, 0x64, 0xca, 0x0a, 0x8d, 0x9b, 0x5b, 0x01, 0x16, 0xb7, 0x42, 0x07, 0x5a, 0x33, 0x67, 0xbc, - 0x70, 0xc1, 0x8f, 0xb0, 0x26, 0x01, 0x28, 0x09, 0x49, 0xff, 0xba, 0xf3, 0xdf, 0x2a, 0xf2, 0x3e, - 0xc5, 0x6a, 0xfc, 0x75, 0xaf, 0x91, 0x47, 0x0e, 0x70, 0xde, 0xd9, 0x02, 0x73, 0x9a, 0xb8, 0x68, - 0xfa, 0xc7, 0x12, 0x34, 0x7b, 0x3c, 0x7a, 0xdc, 0x47, 0x21, 0x71, 0x29, 0x9e, 0x22, 0xd4, 0xa6, - 0x08, 0x8d, 0xbb, 0xb0, 0x1c, 0x50, 0x8c, 0x49, 0x9a, 0x59, 0xcd, 0xcb, 0x9f, 0x0c, 0x07, 0xea, - 0xd2, 0x32, 0xf2, 0x32, 0x94, 0x63, 0x6e, 0xef, 0x6c, 0x4c, 0x8c, 0x8f, 0x4b, 0xf1, 0x93, 0xb3, - 0x01, 0xf1, 0x56, 0x82, 0x6c, 0x61, 0xec, 0x43, 0x2d, 0xf3, 0x97, 0xbe, 0xd0, 0x5d, 0x67, 0xc5, - 0xc6, 0x11, 0xe8, 0xca, 0x51, 0xb5, 0xff, 0xdd, 0x51, 0x8a, 0x37, 0xd7, 0x6f, 0x13, 0xee, 0x94, - 0x24, 0x2a, 0xa4, 0x7b, 0xba, 0x04, 0xb7, 0x7a, 0x3c, 0xea, 0x31, 0x4c, 0x8f, 0xcf, 0x6e, 0xa0, - 0xdd, 0xa6, 0x8a, 0xcb, 0x92, 0xaa, 0x2a, 0xa9, 0x05, 0x14, 0x1f, 0xe0, 0x77, 0x4a, 0xa1, 0xbb, - 0xb0, 0x51, 0x56, 0xa2, 0x90, 0xe8, 0x57, 0x4d, 0x49, 0xb7, 0x8b, 0xf1, 0x6e, 0xbf, 0xcf, 0x7e, - 0x21, 0xd8, 0xcd, 0x8e, 0x7c, 0x85, 0x52, 0xdf, 0xc2, 0x6d, 0x94, 0xe1, 0xfd, 0x92, 0x62, 0xd2, - 0x77, 0xe5, 0x99, 0x9a, 0xa0, 0xcc, 0x5f, 0x48, 0xab, 0xa8, 0x1c, 0xcc, 0x77, 0xd7, 0x82, 0x0f, - 0x66, 0x6c, 0x62, 0xbc, 0xc9, 0x9d, 0xe7, 0x3a, 0x54, 0x7b, 0x3c, 0x32, 0x38, 0xbc, 0x3f, 0xef, - 0xff, 0xca, 0xfd, 0x89, 0xc6, 0xf3, 0xbf, 0x68, 0x96, 0x73, 0x4d, 0xe0, 0xb8, 0xb9, 0x81, 0xc1, - 0x98, 0xf1, 0xd9, 0xeb, 0xce, 0xa6, 0x29, 0x63, 0xac, 0x07, 0x57, 0x63, 0x8a, 0x2e, 0xdf, 0xc3, - 0xea, 0xe4, 0x7b, 0xa5, 0x75, 0xa9, 0xb8, 0x9c, 0xb6, 0x3e, 0xf9, 0xcf, 0x74, 0x41, 0xfb, 0x08, - 0xea, 0xc5, 0x8b, 0xc3, 0x9c, 0x2e, 0x19, 0x67, 0xac, 0xad, 0x79, 0x99, 0x82, 0xe7, 0x00, 0x1a, - 0xff, 0xba, 0xe8, 0xde, 0x34, 0xbc, 0x48, 0x59, 0x1f, 0xcd, 0x4d, 0x15, 0x54, 0x47, 0xb0, 0x76, - 0x69, 0xda, 0x2e, 0x6d, 0x60, 0x1a, 0x61, 0x6d, 0x5f, 0x85, 0x18, 0xf3, 0xbb, 0x87, 0x2f, 0xce, - 0xdb, 0xda, 0xcb, 0xf3, 0xb6, 0xf6, 0xf7, 0x79, 0x5b, 0x7b, 0x76, 0xd1, 0xae, 0xbc, 0xbc, 0x68, - 0x57, 0xfe, 0xbc, 0x68, 0x57, 0x7e, 0xfa, 0xb2, 0x64, 0x1c, 0xf5, 0x1d, 0x4a, 0x63, 0x9a, 0x88, - 0xf2, 0x7f, 0x63, 0x67, 0x34, 0xf1, 0xa4, 0xbc, 0x14, 0x2c, 0xab, 0x6f, 0xc8, 0x17, 0xff, 0x04, - 0x00, 0x00, 0xff, 0xff, 0x11, 0x7a, 0x98, 0x96, 0xcb, 0x0b, 0x00, 0x00, + proto.RegisterType((*MsgUpdateParams)(nil), "fundraising.fundraising.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "fundraising.fundraising.v1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgCreateFixedPriceAuction)(nil), "fundraising.fundraising.v1.MsgCreateFixedPriceAuction") + proto.RegisterType((*MsgCreateFixedPriceAuctionResponse)(nil), "fundraising.fundraising.v1.MsgCreateFixedPriceAuctionResponse") + proto.RegisterType((*MsgCreateBatchAuction)(nil), "fundraising.fundraising.v1.MsgCreateBatchAuction") + proto.RegisterType((*MsgCreateBatchAuctionResponse)(nil), "fundraising.fundraising.v1.MsgCreateBatchAuctionResponse") + proto.RegisterType((*MsgCancelAuction)(nil), "fundraising.fundraising.v1.MsgCancelAuction") + proto.RegisterType((*MsgCancelAuctionResponse)(nil), "fundraising.fundraising.v1.MsgCancelAuctionResponse") + proto.RegisterType((*MsgPlaceBid)(nil), "fundraising.fundraising.v1.MsgPlaceBid") + proto.RegisterType((*MsgPlaceBidResponse)(nil), "fundraising.fundraising.v1.MsgPlaceBidResponse") + proto.RegisterType((*MsgModifyBid)(nil), "fundraising.fundraising.v1.MsgModifyBid") + proto.RegisterType((*MsgModifyBidResponse)(nil), "fundraising.fundraising.v1.MsgModifyBidResponse") + proto.RegisterType((*MsgAddAllowedBidder)(nil), "fundraising.fundraising.v1.MsgAddAllowedBidder") + proto.RegisterType((*MsgAddAllowedBidderResponse)(nil), "fundraising.fundraising.v1.MsgAddAllowedBidderResponse") +} + +func init() { + proto.RegisterFile("fundraising/fundraising/v1/tx.proto", fileDescriptor_bd48063046df62e0) +} + +var fileDescriptor_bd48063046df62e0 = []byte{ + // 1161 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0x4d, 0x6f, 0x1b, 0x45, + 0x18, 0xce, 0x36, 0xb6, 0x1b, 0x8f, 0x93, 0x36, 0xd9, 0x36, 0xad, 0xbb, 0x55, 0xed, 0xc8, 0xad, + 0x94, 0x34, 0x34, 0xbb, 0x38, 0x85, 0x22, 0x22, 0x54, 0x94, 0x4d, 0x02, 0xaa, 0x84, 0x45, 0xb4, + 0xfd, 0x38, 0x70, 0xc0, 0x1a, 0xef, 0x4c, 0x36, 0xa3, 0x7a, 0x77, 0xad, 0x9d, 0x71, 0xb0, 0x25, + 0x0e, 0xa8, 0xdc, 0x38, 0x95, 0x2b, 0xe2, 0x07, 0x54, 0x9c, 0x72, 0xe8, 0x85, 0x7f, 0xd0, 0x13, + 0x8a, 0x7a, 0x02, 0x0e, 0x2d, 0x4a, 0x0e, 0xf9, 0x1b, 0x68, 0x3e, 0xbc, 0x59, 0xbb, 0xb1, 0x1d, + 0xa7, 0x15, 0x20, 0x2e, 0xc9, 0xee, 0xfb, 0x3e, 0xef, 0xc7, 0x3c, 0xf3, 0xbc, 0xb3, 0x63, 0x70, + 0x7d, 0xab, 0x19, 0xa0, 0x08, 0x12, 0x4a, 0x02, 0xcf, 0x4a, 0x3e, 0xef, 0x94, 0x2d, 0xd6, 0x32, + 0x1b, 0x51, 0xc8, 0x42, 0xdd, 0x48, 0x38, 0xcc, 0xe4, 0xf3, 0x4e, 0xd9, 0x98, 0x81, 0x3e, 0x09, + 0x42, 0x4b, 0xfc, 0x95, 0x70, 0xa3, 0xe0, 0x86, 0xd4, 0x0f, 0xa9, 0x55, 0x83, 0x14, 0x5b, 0x3b, + 0xe5, 0x1a, 0x66, 0xb0, 0x6c, 0xb9, 0x21, 0x09, 0x94, 0xff, 0xb2, 0xf2, 0xfb, 0x54, 0x94, 0xf1, + 0xa9, 0xa7, 0x1c, 0x57, 0xa4, 0xa3, 0x2a, 0xde, 0x2c, 0xf9, 0xa2, 0x5c, 0xd6, 0x80, 0x3e, 0x61, + 0xbd, 0x1e, 0x7e, 0x83, 0x51, 0xb5, 0x46, 0x10, 0xc2, 0x91, 0x0a, 0x58, 0x18, 0x14, 0xd0, 0x74, + 0x19, 0x09, 0x3b, 0xed, 0xdc, 0x18, 0x80, 0xac, 0x11, 0xa4, 0x50, 0xf3, 0x03, 0x50, 0x0d, 0x18, + 0x41, 0xbf, 0xd3, 0xe9, 0x45, 0x2f, 0xf4, 0x42, 0xb9, 0x02, 0xfe, 0xa4, 0xac, 0x45, 0x2f, 0x0c, + 0xbd, 0x3a, 0xb6, 0xc4, 0x5b, 0xad, 0xb9, 0x65, 0x31, 0xe2, 0x63, 0xca, 0xa0, 0xdf, 0x90, 0x80, + 0xd2, 0x6f, 0x1a, 0x38, 0x5f, 0xa1, 0xde, 0xc3, 0x06, 0x82, 0x0c, 0x6f, 0x8a, 0x84, 0xfa, 0x1d, + 0x90, 0x85, 0x4d, 0xb6, 0x1d, 0x46, 0x84, 0xb5, 0xf3, 0xda, 0x9c, 0xb6, 0x90, 0xb5, 0xf3, 0x2f, + 0x9f, 0x2f, 0x5d, 0x54, 0xcc, 0xac, 0x22, 0x14, 0x61, 0x4a, 0xef, 0xb3, 0x88, 0x04, 0x9e, 0x73, + 0x04, 0xd5, 0x37, 0x40, 0x46, 0xb6, 0x94, 0x3f, 0x33, 0xa7, 0x2d, 0xe4, 0x96, 0x4b, 0x66, 0xff, + 0x0d, 0x34, 0x65, 0x2d, 0x3b, 0xfb, 0xe2, 0x55, 0x71, 0xec, 0xd9, 0xe1, 0xee, 0xa2, 0xe6, 0xa8, + 0xe0, 0x95, 0x4f, 0x9e, 0x1c, 0xee, 0x2e, 0x1e, 0xa5, 0xfd, 0xe1, 0x70, 0x77, 0xf1, 0x66, 0x72, + 0xe5, 0xad, 0x2e, 0x1e, 0x7a, 0x9a, 0x2f, 0x5d, 0x01, 0x97, 0x7b, 0x4c, 0x0e, 0xa6, 0x8d, 0x30, + 0xa0, 0xb8, 0xf4, 0x6b, 0x0a, 0x18, 0x15, 0xea, 0xad, 0x45, 0x18, 0x32, 0xfc, 0x19, 0x69, 0x61, + 0xb4, 0x19, 0x11, 0x17, 0xaf, 0xca, 0x6d, 0xd1, 0x0b, 0x00, 0xa8, 0x1d, 0xc2, 0x38, 0x92, 0xeb, + 0x76, 0x12, 0x16, 0xdd, 0x01, 0x39, 0xca, 0x60, 0xc4, 0xaa, 0x0d, 0x1e, 0x25, 0xd6, 0x98, 0xb5, + 0xcb, 0xbc, 0xff, 0x3f, 0x5f, 0x15, 0xaf, 0x4a, 0x72, 0x28, 0x7a, 0x6c, 0x92, 0xd0, 0xf2, 0x21, + 0xdb, 0x36, 0xbf, 0xc0, 0x1e, 0x74, 0xdb, 0xeb, 0xd8, 0x7d, 0xf9, 0x7c, 0x09, 0x28, 0xee, 0xd6, + 0xb1, 0xeb, 0x00, 0x91, 0x45, 0x94, 0xd6, 0xbf, 0xd7, 0xc0, 0x24, 0xc5, 0xf5, 0x3a, 0x09, 0xbc, + 0x2a, 0x97, 0x6a, 0x7e, 0x5c, 0x30, 0x77, 0xc5, 0x54, 0x78, 0xae, 0x65, 0x53, 0x69, 0xd9, 0x5c, + 0x0b, 0x49, 0x60, 0x6f, 0xf0, 0x82, 0xbf, 0xbc, 0x2e, 0xce, 0x7b, 0x84, 0x6d, 0x37, 0x6b, 0xa6, + 0x1b, 0xfa, 0x4a, 0xb2, 0xea, 0xdf, 0x12, 0x45, 0x8f, 0x2d, 0xd6, 0x6e, 0x60, 0x2a, 0x02, 0x7e, + 0x3a, 0xdc, 0x5d, 0x9c, 0xac, 0x8b, 0x56, 0x44, 0x05, 0x2a, 0xc9, 0xce, 0xa9, 0xaa, 0x1c, 0xa2, + 0x2f, 0x82, 0x99, 0x06, 0x6c, 0x77, 0x7a, 0xa8, 0x22, 0x1c, 0x84, 0x7e, 0x3e, 0x25, 0x08, 0x38, + 0x2f, 0x1d, 0x1c, 0xb6, 0xce, 0xcd, 0xfa, 0xd7, 0x60, 0x66, 0x07, 0x53, 0xc6, 0xc1, 0xd4, 0xdd, + 0xc6, 0xa8, 0x59, 0xc7, 0x34, 0x9f, 0x9e, 0x1b, 0x5f, 0xc8, 0x2d, 0xbf, 0x37, 0x68, 0xbf, 0x1f, + 0xc9, 0xa0, 0xfb, 0x2a, 0xc6, 0x4e, 0xf1, 0x75, 0x38, 0xd3, 0x3b, 0xdd, 0x66, 0xaa, 0xaf, 0x01, + 0xc9, 0x4f, 0x95, 0x2b, 0x35, 0x9f, 0x11, 0x74, 0x18, 0xa6, 0x94, 0xb1, 0xd9, 0x91, 0xb1, 0xf9, + 0xa0, 0x23, 0x63, 0x7b, 0x82, 0xe7, 0x79, 0xfa, 0xba, 0xa8, 0x39, 0x59, 0x11, 0xc7, 0x3d, 0xfa, + 0xa7, 0x60, 0x02, 0x07, 0x48, 0xa6, 0x38, 0x3b, 0x42, 0x8a, 0xb3, 0x38, 0x40, 0xdc, 0xbe, 0x72, + 0x9e, 0x6b, 0x30, 0xb1, 0xf9, 0xa5, 0x1b, 0xa0, 0xd4, 0x5f, 0x3a, 0xb1, 0xc2, 0x7e, 0xce, 0x80, + 0xd9, 0x18, 0x66, 0x43, 0xe6, 0x6e, 0xff, 0x9b, 0xe2, 0x7a, 0x08, 0xa6, 0x7c, 0x12, 0xf0, 0xf3, + 0x49, 0x65, 0x1d, 0x3f, 0x6d, 0xd6, 0x9c, 0x4f, 0x02, 0x9b, 0xa0, 0x3e, 0x9a, 0x4d, 0xfd, 0x67, + 0x34, 0x9b, 0x1e, 0x41, 0xb3, 0x99, 0x77, 0xa7, 0xd9, 0x5b, 0x40, 0xf7, 0x61, 0xab, 0x8a, 0x5b, + 0x0c, 0x07, 0x08, 0xa3, 0x6a, 0x14, 0x36, 0x03, 0x24, 0x84, 0x37, 0xe5, 0x4c, 0xfb, 0xb0, 0xb5, + 0xa1, 0x1c, 0x0e, 0xb7, 0xeb, 0x10, 0x5c, 0xe8, 0x46, 0x56, 0x23, 0xc8, 0x70, 0x7e, 0xe2, 0xb4, + 0x9b, 0x33, 0x83, 0x93, 0xe9, 0x1d, 0xc8, 0x70, 0xcf, 0x10, 0x65, 0xdf, 0x7e, 0x88, 0xc0, 0x3b, + 0x19, 0xa2, 0x22, 0xb8, 0x76, 0xec, 0x74, 0xc4, 0xf3, 0x53, 0x03, 0xd3, 0x1c, 0x00, 0x03, 0x17, + 0xd7, 0x4f, 0x3a, 0x39, 0xd7, 0x62, 0x7f, 0x95, 0x20, 0x31, 0x38, 0x29, 0xfe, 0x51, 0x12, 0x96, + 0x7b, 0xe8, 0xcd, 0x26, 0x0c, 0x90, 0xef, 0xad, 0x11, 0xd7, 0xdf, 0x3b, 0x03, 0x72, 0x15, 0xea, + 0x6d, 0xd6, 0xa1, 0x8b, 0x6d, 0x82, 0x7a, 0x72, 0x6b, 0x3d, 0xb9, 0xf5, 0x4b, 0x20, 0x23, 0x3f, + 0xfe, 0x72, 0x5e, 0x1d, 0xf5, 0xa6, 0xdf, 0x05, 0x13, 0x7c, 0xe8, 0xb8, 0xa0, 0xc5, 0xcc, 0x9d, + 0x5b, 0xbe, 0x3e, 0x48, 0x66, 0x36, 0x41, 0x0f, 0xda, 0x0d, 0xec, 0x9c, 0xad, 0xc9, 0x07, 0xfd, + 0x73, 0x90, 0x96, 0x03, 0x9b, 0x3a, 0xad, 0x26, 0x64, 0xbc, 0xce, 0x40, 0x4a, 0x4c, 0x68, 0xfa, + 0x1f, 0x9a, 0x50, 0x51, 0x6d, 0x25, 0xc7, 0x29, 0x57, 0x5c, 0x94, 0x66, 0xc1, 0x85, 0x04, 0xa3, + 0x31, 0xd3, 0xcf, 0xce, 0x80, 0xc9, 0x0a, 0xf5, 0x2a, 0x21, 0x22, 0x5b, 0xed, 0xb7, 0xa0, 0x7a, + 0x56, 0xd8, 0x79, 0xc8, 0xb8, 0x08, 0x49, 0xd7, 0x08, 0xba, 0x87, 0xfe, 0x57, 0x0c, 0x5e, 0x02, + 0x17, 0x93, 0x4c, 0x1d, 0x51, 0xa8, 0x09, 0x6a, 0x57, 0x11, 0x5a, 0x95, 0x37, 0x51, 0x5b, 0x52, + 0x32, 0x84, 0xc9, 0x47, 0xe0, 0x5c, 0xf7, 0xcd, 0x55, 0xdd, 0xd6, 0x6e, 0x0e, 0x92, 0x68, 0x57, + 0x05, 0x75, 0x0e, 0x4e, 0xc1, 0xa4, 0x71, 0xc5, 0xe0, 0x3d, 0xcf, 0xf6, 0x5c, 0x8a, 0xd5, 0x12, + 0xae, 0x81, 0xab, 0xc7, 0x74, 0xda, 0x59, 0xc9, 0xf2, 0x1f, 0x19, 0x30, 0x5e, 0xa1, 0x9e, 0xde, + 0x00, 0x93, 0x5d, 0x17, 0xd1, 0x81, 0x87, 0x73, 0xcf, 0x2d, 0xcf, 0xb8, 0x3d, 0x02, 0xb8, 0x53, + 0x59, 0xff, 0x51, 0x03, 0x97, 0xfb, 0xdd, 0x07, 0xef, 0x0c, 0x49, 0xd8, 0x27, 0xce, 0xb8, 0x7b, + 0xba, 0xb8, 0xb8, 0xa7, 0x27, 0x1a, 0xd0, 0x8f, 0xb9, 0x41, 0x94, 0x4f, 0x94, 0x36, 0x19, 0x62, + 0x7c, 0x3c, 0x72, 0x48, 0xdc, 0x04, 0x05, 0x53, 0xdd, 0xc7, 0xf0, 0xad, 0x61, 0xb9, 0x92, 0x68, + 0xe3, 0x83, 0x51, 0xd0, 0x71, 0x51, 0x04, 0x26, 0xe2, 0xa3, 0x77, 0x7e, 0x48, 0x86, 0x0e, 0xd0, + 0xb0, 0x4e, 0x08, 0x8c, 0xab, 0x78, 0x20, 0x7b, 0x74, 0xec, 0x2c, 0x0c, 0x89, 0x8e, 0x91, 0xc6, + 0xfb, 0x27, 0x45, 0xc6, 0x85, 0xbe, 0x05, 0xd3, 0x6f, 0x0c, 0xe7, 0xb0, 0x6e, 0x7b, 0x03, 0x8c, + 0x8f, 0x46, 0x0c, 0xe8, 0x54, 0x37, 0xd2, 0xdf, 0xf1, 0x03, 0xc5, 0xfe, 0xf2, 0xc5, 0x7e, 0x41, + 0xdb, 0xdb, 0x2f, 0x68, 0x7f, 0xed, 0x17, 0xb4, 0xa7, 0x07, 0x85, 0xb1, 0xbd, 0x83, 0xc2, 0xd8, + 0xef, 0x07, 0x85, 0xb1, 0xaf, 0x3e, 0x4c, 0x9c, 0x54, 0xe2, 0x02, 0x11, 0xf9, 0x24, 0x60, 0x56, + 0xff, 0x9f, 0x5a, 0xe2, 0xf0, 0xaa, 0x65, 0xc4, 0xc7, 0xff, 0xf6, 0xdf, 0x01, 0x00, 0x00, 0xff, + 0xff, 0xc3, 0xaa, 0x61, 0x24, 0xc3, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -653,10 +945,12 @@ 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 { - // this line is used by Starport scaffolding # proto/tx/rpc - // Submit a create fixed price auction message. + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // CreateFixedPriceAuction submits a create fixed price auction message. CreateFixedPriceAuction(ctx context.Context, in *MsgCreateFixedPriceAuction, opts ...grpc.CallOption) (*MsgCreateFixedPriceAuctionResponse, error) - // Submit a create batch auction message. + // CreateBatchAuction submits a create batch auction message. CreateBatchAuction(ctx context.Context, in *MsgCreateBatchAuction, opts ...grpc.CallOption) (*MsgCreateBatchAuctionResponse, error) // CancelAuction defines a method to cancel the auction message. CancelAuction(ctx context.Context, in *MsgCancelAuction, opts ...grpc.CallOption) (*MsgCancelAuctionResponse, error) @@ -677,9 +971,18 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/fundraising.fundraising.v1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) CreateFixedPriceAuction(ctx context.Context, in *MsgCreateFixedPriceAuction, opts ...grpc.CallOption) (*MsgCreateFixedPriceAuctionResponse, error) { out := new(MsgCreateFixedPriceAuctionResponse) - err := c.cc.Invoke(ctx, "/fundraising.Msg/CreateFixedPriceAuction", in, out, opts...) + err := c.cc.Invoke(ctx, "/fundraising.fundraising.v1.Msg/CreateFixedPriceAuction", in, out, opts...) if err != nil { return nil, err } @@ -688,7 +991,7 @@ func (c *msgClient) CreateFixedPriceAuction(ctx context.Context, in *MsgCreateFi func (c *msgClient) CreateBatchAuction(ctx context.Context, in *MsgCreateBatchAuction, opts ...grpc.CallOption) (*MsgCreateBatchAuctionResponse, error) { out := new(MsgCreateBatchAuctionResponse) - err := c.cc.Invoke(ctx, "/fundraising.Msg/CreateBatchAuction", in, out, opts...) + err := c.cc.Invoke(ctx, "/fundraising.fundraising.v1.Msg/CreateBatchAuction", in, out, opts...) if err != nil { return nil, err } @@ -697,7 +1000,7 @@ func (c *msgClient) CreateBatchAuction(ctx context.Context, in *MsgCreateBatchAu func (c *msgClient) CancelAuction(ctx context.Context, in *MsgCancelAuction, opts ...grpc.CallOption) (*MsgCancelAuctionResponse, error) { out := new(MsgCancelAuctionResponse) - err := c.cc.Invoke(ctx, "/fundraising.Msg/CancelAuction", in, out, opts...) + err := c.cc.Invoke(ctx, "/fundraising.fundraising.v1.Msg/CancelAuction", in, out, opts...) if err != nil { return nil, err } @@ -706,7 +1009,7 @@ func (c *msgClient) CancelAuction(ctx context.Context, in *MsgCancelAuction, opt func (c *msgClient) PlaceBid(ctx context.Context, in *MsgPlaceBid, opts ...grpc.CallOption) (*MsgPlaceBidResponse, error) { out := new(MsgPlaceBidResponse) - err := c.cc.Invoke(ctx, "/fundraising.Msg/PlaceBid", in, out, opts...) + err := c.cc.Invoke(ctx, "/fundraising.fundraising.v1.Msg/PlaceBid", in, out, opts...) if err != nil { return nil, err } @@ -715,7 +1018,7 @@ func (c *msgClient) PlaceBid(ctx context.Context, in *MsgPlaceBid, opts ...grpc. func (c *msgClient) ModifyBid(ctx context.Context, in *MsgModifyBid, opts ...grpc.CallOption) (*MsgModifyBidResponse, error) { out := new(MsgModifyBidResponse) - err := c.cc.Invoke(ctx, "/fundraising.Msg/ModifyBid", in, out, opts...) + err := c.cc.Invoke(ctx, "/fundraising.fundraising.v1.Msg/ModifyBid", in, out, opts...) if err != nil { return nil, err } @@ -724,7 +1027,7 @@ func (c *msgClient) ModifyBid(ctx context.Context, in *MsgModifyBid, opts ...grp func (c *msgClient) AddAllowedBidder(ctx context.Context, in *MsgAddAllowedBidder, opts ...grpc.CallOption) (*MsgAddAllowedBidderResponse, error) { out := new(MsgAddAllowedBidderResponse) - err := c.cc.Invoke(ctx, "/fundraising.Msg/AddAllowedBidder", in, out, opts...) + err := c.cc.Invoke(ctx, "/fundraising.fundraising.v1.Msg/AddAllowedBidder", in, out, opts...) if err != nil { return nil, err } @@ -733,10 +1036,12 @@ func (c *msgClient) AddAllowedBidder(ctx context.Context, in *MsgAddAllowedBidde // MsgServer is the server API for Msg service. type MsgServer interface { - // this line is used by Starport scaffolding # proto/tx/rpc - // Submit a create fixed price auction message. + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // CreateFixedPriceAuction submits a create fixed price auction message. CreateFixedPriceAuction(context.Context, *MsgCreateFixedPriceAuction) (*MsgCreateFixedPriceAuctionResponse, error) - // Submit a create batch auction message. + // CreateBatchAuction submits a create batch auction message. CreateBatchAuction(context.Context, *MsgCreateBatchAuction) (*MsgCreateBatchAuctionResponse, error) // CancelAuction defines a method to cancel the auction message. CancelAuction(context.Context, *MsgCancelAuction) (*MsgCancelAuctionResponse, error) @@ -753,6 +1058,9 @@ type MsgServer interface { type UnimplementedMsgServer struct { } +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} func (*UnimplementedMsgServer) CreateFixedPriceAuction(ctx context.Context, req *MsgCreateFixedPriceAuction) (*MsgCreateFixedPriceAuctionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateFixedPriceAuction not implemented") } @@ -776,6 +1084,24 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/fundraising.fundraising.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_CreateFixedPriceAuction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgCreateFixedPriceAuction) if err := dec(in); err != nil { @@ -786,7 +1112,7 @@ func _Msg_CreateFixedPriceAuction_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/fundraising.Msg/CreateFixedPriceAuction", + FullMethod: "/fundraising.fundraising.v1.Msg/CreateFixedPriceAuction", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).CreateFixedPriceAuction(ctx, req.(*MsgCreateFixedPriceAuction)) @@ -804,7 +1130,7 @@ func _Msg_CreateBatchAuction_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/fundraising.Msg/CreateBatchAuction", + FullMethod: "/fundraising.fundraising.v1.Msg/CreateBatchAuction", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).CreateBatchAuction(ctx, req.(*MsgCreateBatchAuction)) @@ -822,7 +1148,7 @@ func _Msg_CancelAuction_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/fundraising.Msg/CancelAuction", + FullMethod: "/fundraising.fundraising.v1.Msg/CancelAuction", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).CancelAuction(ctx, req.(*MsgCancelAuction)) @@ -840,7 +1166,7 @@ func _Msg_PlaceBid_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/fundraising.Msg/PlaceBid", + FullMethod: "/fundraising.fundraising.v1.Msg/PlaceBid", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).PlaceBid(ctx, req.(*MsgPlaceBid)) @@ -858,7 +1184,7 @@ func _Msg_ModifyBid_Handler(srv interface{}, ctx context.Context, dec func(inter } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/fundraising.Msg/ModifyBid", + FullMethod: "/fundraising.fundraising.v1.Msg/ModifyBid", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).ModifyBid(ctx, req.(*MsgModifyBid)) @@ -876,7 +1202,7 @@ func _Msg_AddAllowedBidder_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/fundraising.Msg/AddAllowedBidder", + FullMethod: "/fundraising.fundraising.v1.Msg/AddAllowedBidder", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).AddAllowedBidder(ctx, req.(*MsgAddAllowedBidder)) @@ -885,9 +1211,13 @@ func _Msg_AddAllowedBidder_Handler(srv interface{}, ctx context.Context, dec fun } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "fundraising.Msg", + ServiceName: "fundraising.fundraising.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, { MethodName: "CreateFixedPriceAuction", Handler: _Msg_CreateFixedPriceAuction_Handler, @@ -914,7 +1244,70 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "fundraising/tx.proto", + Metadata: "fundraising/fundraising/v1/tx.proto", +} + +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil } func (m *MsgCreateFixedPriceAuction) Marshal() (dAtA []byte, err error) { @@ -937,21 +1330,21 @@ func (m *MsgCreateFixedPriceAuction) MarshalToSizedBuffer(dAtA []byte) (int, err _ = i var l int _ = l - n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintTx(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x3a - n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime):]) + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime):]) if err2 != nil { return 0, err2 } i -= n2 i = encodeVarintTx(dAtA, i, uint64(n2)) i-- + dAtA[i] = 0x3a + 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 = encodeVarintTx(dAtA, i, uint64(n3)) + i-- dAtA[i] = 0x32 if len(m.VestingSchedules) > 0 { for iNdEx := len(m.VestingSchedules) - 1; iNdEx >= 0; iNdEx-- { @@ -1047,21 +1440,21 @@ func (m *MsgCreateBatchAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintTx(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x52 - n5, err5 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime):]) + n5, err5 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime):]) if err5 != nil { return 0, err5 } i -= n5 i = encodeVarintTx(dAtA, i, uint64(n5)) i-- + dAtA[i] = 0x52 + n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintTx(dAtA, i, uint64(n6)) + i-- dAtA[i] = 0x4a { size := m.ExtendedRoundRate.Size() @@ -1458,6 +1851,30 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgCreateFixedPriceAuction) Size() (n int) { if m == nil { return 0 @@ -1663,6 +2080,171 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgCreateFixedPriceAuction) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/fundraising/types/utils.go b/x/fundraising/types/utils.go index 30c0cdab..fe683149 100644 --- a/x/fundraising/types/utils.go +++ b/x/fundraising/types/utils.go @@ -4,6 +4,7 @@ import ( "sort" "time" + "cosmossdk.io/math" "github.com/cometbft/cometbft/crypto" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" @@ -43,7 +44,7 @@ func SortBids(bids []Bid) []Bid { return bids } -func BidsByPrice(bids []Bid) (prices []sdk.Dec, bidsByPrice map[string][]Bid) { +func BidsByPrice(bids []Bid) (prices []math.LegacyDec, bidsByPrice map[string][]Bid) { bids = SortBids(bids) bidsByPrice = map[string][]Bid{} // price => []Bid @@ -54,10 +55,10 @@ func BidsByPrice(bids []Bid) (prices []sdk.Dec, bidsByPrice map[string][]Bid) { } // Sort prices in descending order. - prices = make([]sdk.Dec, len(bidsByPrice)) + prices = make([]math.LegacyDec, len(bidsByPrice)) i := 0 for priceStr := range bidsByPrice { - prices[i] = sdk.MustNewDecFromStr(priceStr) + prices[i] = math.LegacyMustNewDecFromStr(priceStr) i++ } sort.Slice(prices, func(i, j int) bool { diff --git a/x/fundraising/types/utils_test.go b/x/fundraising/types/utils_test.go index 5b76dfb2..d418b338 100644 --- a/x/fundraising/types/utils_test.go +++ b/x/fundraising/types/utils_test.go @@ -5,6 +5,7 @@ import ( "testing" "time" + "cosmossdk.io/math" "github.com/cometbft/cometbft/crypto" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -127,28 +128,28 @@ func TestSortByBidPrice(t *testing.T) { AuctionId: 1, Bidder: sdk.AccAddress(crypto.AddressHash([]byte("Bidder1"))).String(), Id: 1, - Price: sdk.MustNewDecFromStr("0.10"), + Price: math.LegacyMustNewDecFromStr("0.10"), Coin: sdk.NewInt64Coin("denom1", 1), }, { AuctionId: 1, Bidder: sdk.AccAddress(crypto.AddressHash([]byte("Bidder2"))).String(), Id: 2, - Price: sdk.MustNewDecFromStr("1.10"), + Price: math.LegacyMustNewDecFromStr("1.10"), Coin: sdk.NewInt64Coin("denom1", 1), }, { AuctionId: 1, Bidder: sdk.AccAddress(crypto.AddressHash([]byte("Bidder3"))).String(), Id: 3, - Price: sdk.MustNewDecFromStr("0.35"), + Price: math.LegacyMustNewDecFromStr("0.35"), Coin: sdk.NewInt64Coin("denom1", 1), }, { AuctionId: 1, Bidder: sdk.AccAddress(crypto.AddressHash([]byte("Bidder4"))).String(), Id: 4, - Price: sdk.MustNewDecFromStr("0.77"), + Price: math.LegacyMustNewDecFromStr("0.77"), Coin: sdk.NewInt64Coin("denom1", 1), }, } diff --git a/x/fundraising/types/vesting.go b/x/fundraising/types/vesting.go index a56e25ab..b5b69ddb 100644 --- a/x/fundraising/types/vesting.go +++ b/x/fundraising/types/vesting.go @@ -3,8 +3,9 @@ package types import ( "time" + sdkerrors "cosmossdk.io/errors" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // ValidateVestingSchedules validates the vesting schedules. @@ -16,7 +17,7 @@ func ValidateVestingSchedules(schedules []VestingSchedule, endTime time.Time) er return nil } - totalWeight := sdk.ZeroDec() + totalWeight := math.LegacyZeroDec() prevReleaseTime := MustParseRFC3339("0001-01-01T00:00:00Z") for _, s := range schedules { @@ -32,7 +33,7 @@ func ValidateVestingSchedules(schedules []VestingSchedule, endTime time.Time) er return sdkerrors.Wrapf(ErrInvalidVestingSchedules, "release time must be chronological") } - if s.Weight.GT(sdk.OneDec()) { + if s.Weight.GT(math.LegacyOneDec()) { return sdkerrors.Wrapf(ErrInvalidVestingSchedules, "vesting weight must not be greater than 1") } @@ -40,7 +41,7 @@ func ValidateVestingSchedules(schedules []VestingSchedule, endTime time.Time) er prevReleaseTime = s.ReleaseTime } - if !totalWeight.Equal(sdk.OneDec()) { + if !totalWeight.Equal(math.LegacyOneDec()) { return sdkerrors.Wrapf(ErrInvalidVestingSchedules, "total vesting weight must be equal to 1") } diff --git a/x/fundraising/types/vesting_queue.pb.go b/x/fundraising/types/vesting_queue.pb.go new file mode 100644 index 00000000..840151dc --- /dev/null +++ b/x/fundraising/types/vesting_queue.pb.go @@ -0,0 +1,526 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fundraising/fundraising/v1/vesting_queue.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + 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" + 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. +// 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 + +// VestingQueue defines the vesting queue. +type VestingQueue struct { + // auction_id specifies the id of the auction + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + // auctioneer specifies the bech32-encoded address that creates the auction + Auctioneer string `protobuf:"bytes,2,opt,name=auctioneer,proto3" json:"auctioneer,omitempty"` + // paying_coin specifies the paying amount of coin + PayingCoin types.Coin `protobuf:"bytes,3,opt,name=paying_coin,json=payingCoin,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"paying_coin"` + // release_time specifies the timestamp of the vesting schedule + ReleaseTime time.Time `protobuf:"bytes,4,opt,name=release_time,json=releaseTime,proto3,stdtime" json:"release_time"` + // released specifies the status of distribution + Released bool `protobuf:"varint,5,opt,name=released,proto3" json:"released,omitempty"` +} + +func (m *VestingQueue) Reset() { *m = VestingQueue{} } +func (m *VestingQueue) String() string { return proto.CompactTextString(m) } +func (*VestingQueue) ProtoMessage() {} +func (*VestingQueue) Descriptor() ([]byte, []int) { + return fileDescriptor_d67ffad82b4f4ad3, []int{0} +} +func (m *VestingQueue) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VestingQueue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VestingQueue.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 *VestingQueue) XXX_Merge(src proto.Message) { + xxx_messageInfo_VestingQueue.Merge(m, src) +} +func (m *VestingQueue) XXX_Size() int { + return m.Size() +} +func (m *VestingQueue) XXX_DiscardUnknown() { + xxx_messageInfo_VestingQueue.DiscardUnknown(m) +} + +var xxx_messageInfo_VestingQueue proto.InternalMessageInfo + +func (m *VestingQueue) GetAuctionId() uint64 { + if m != nil { + return m.AuctionId + } + return 0 +} + +func (m *VestingQueue) GetAuctioneer() string { + if m != nil { + return m.Auctioneer + } + return "" +} + +func (m *VestingQueue) GetPayingCoin() types.Coin { + if m != nil { + return m.PayingCoin + } + return types.Coin{} +} + +func (m *VestingQueue) GetReleaseTime() time.Time { + if m != nil { + return m.ReleaseTime + } + return time.Time{} +} + +func (m *VestingQueue) GetReleased() bool { + if m != nil { + return m.Released + } + return false +} + +func init() { + proto.RegisterType((*VestingQueue)(nil), "fundraising.fundraising.v1.VestingQueue") +} + +func init() { + proto.RegisterFile("fundraising/fundraising/v1/vesting_queue.proto", fileDescriptor_d67ffad82b4f4ad3) +} + +var fileDescriptor_d67ffad82b4f4ad3 = []byte{ + // 408 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x52, 0x3f, 0x6f, 0xd4, 0x30, + 0x1c, 0x3d, 0x97, 0x82, 0xae, 0xbe, 0x5b, 0x88, 0x18, 0xd2, 0x48, 0xf8, 0x4e, 0x2c, 0x9c, 0x2a, + 0x61, 0xeb, 0x40, 0x7c, 0x81, 0x43, 0x08, 0x31, 0x21, 0x22, 0xc4, 0xc0, 0x72, 0x72, 0x92, 0x5f, + 0x8d, 0xc5, 0xc5, 0x0e, 0xb1, 0x13, 0x71, 0x23, 0xdf, 0xa0, 0x33, 0x9f, 0x00, 0x31, 0x75, 0xe2, + 0x33, 0x74, 0xec, 0xc8, 0x44, 0xd1, 0xdd, 0xd0, 0xaf, 0x81, 0xfc, 0xa7, 0x55, 0xba, 0x24, 0x7e, + 0xbf, 0xf7, 0x7e, 0xf2, 0x7b, 0x4f, 0xc6, 0xf4, 0xb4, 0x53, 0x55, 0xcb, 0xa5, 0x91, 0x4a, 0xb0, + 0xe1, 0xb9, 0x5f, 0xb2, 0x1e, 0x8c, 0x95, 0x4a, 0xac, 0xbf, 0x76, 0xd0, 0x01, 0x6d, 0x5a, 0x6d, + 0x75, 0x92, 0x0d, 0x34, 0xc3, 0x5d, 0xda, 0x2f, 0xb3, 0x87, 0xbc, 0x96, 0x4a, 0x33, 0xff, 0x0d, + 0xf2, 0x8c, 0x94, 0xda, 0xd4, 0xda, 0xb0, 0x82, 0x1b, 0x60, 0xfd, 0xb2, 0x00, 0xcb, 0x97, 0xac, + 0xd4, 0x52, 0x45, 0xfe, 0x38, 0xf0, 0x6b, 0x8f, 0x58, 0x00, 0x91, 0x7a, 0x24, 0xb4, 0xd0, 0x61, + 0xee, 0x4e, 0x71, 0x3a, 0x13, 0x5a, 0x8b, 0x0d, 0x30, 0x8f, 0x8a, 0xee, 0x94, 0x59, 0x59, 0x83, + 0xb1, 0xbc, 0x6e, 0x82, 0xe0, 0xc9, 0xef, 0x03, 0x3c, 0xfd, 0x18, 0x8c, 0xbf, 0x77, 0xbe, 0x93, + 0xc7, 0x18, 0xf3, 0xae, 0xb4, 0x52, 0xab, 0xb5, 0xac, 0x52, 0x34, 0x47, 0x8b, 0xc3, 0xfc, 0x28, + 0x4e, 0xde, 0x56, 0x09, 0xb9, 0xa5, 0x01, 0xda, 0xf4, 0x60, 0x8e, 0x16, 0x47, 0xf9, 0x60, 0x92, + 0x7c, 0x47, 0x78, 0xd2, 0xf0, 0xad, 0xeb, 0xc1, 0xf9, 0x4e, 0xef, 0xcd, 0xd1, 0x62, 0xf2, 0xfc, + 0x98, 0x46, 0xaf, 0x2e, 0x18, 0x8d, 0xc1, 0xe8, 0x2b, 0x2d, 0xd5, 0xea, 0xf5, 0xc5, 0xdf, 0xd9, + 0xe8, 0xd7, 0xd5, 0xec, 0xa9, 0x90, 0xf6, 0x73, 0x57, 0xd0, 0x52, 0xd7, 0x31, 0x58, 0xfc, 0x3d, + 0x33, 0xd5, 0x17, 0x66, 0xb7, 0x0d, 0x18, 0xbf, 0xf0, 0xe3, 0xfa, 0xfc, 0x64, 0xba, 0x01, 0xc1, + 0xcb, 0xad, 0xbf, 0xc1, 0xfc, 0xbc, 0x3e, 0x3f, 0x41, 0x39, 0x0e, 0x97, 0x3a, 0x45, 0xf2, 0x06, + 0x4f, 0x5b, 0xd8, 0x00, 0x37, 0xb0, 0x76, 0x71, 0xd3, 0x43, 0xef, 0x21, 0xa3, 0xa1, 0x0b, 0x7a, + 0xd3, 0x05, 0xfd, 0x70, 0xd3, 0xc5, 0x6a, 0xec, 0x4c, 0x9c, 0x5d, 0xcd, 0x50, 0x3e, 0x89, 0x9b, + 0x8e, 0x4b, 0x32, 0x3c, 0x8e, 0xb0, 0x4a, 0xef, 0xcf, 0xd1, 0x62, 0x9c, 0xdf, 0xe2, 0xd5, 0xbb, + 0x8b, 0x1d, 0x41, 0x97, 0x3b, 0x82, 0xfe, 0xed, 0x08, 0x3a, 0xdb, 0x93, 0xd1, 0xe5, 0x9e, 0x8c, + 0xfe, 0xec, 0xc9, 0xe8, 0xd3, 0xcb, 0x41, 0x12, 0x0b, 0xaa, 0x82, 0xb6, 0x96, 0xca, 0xde, 0x79, + 0x2d, 0xdf, 0xee, 0x20, 0x1f, 0xae, 0x78, 0xe0, 0x7d, 0xbd, 0xf8, 0x1f, 0x00, 0x00, 0xff, 0xff, + 0x37, 0x74, 0x50, 0xf6, 0x63, 0x02, 0x00, 0x00, +} + +func (m *VestingQueue) 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 *VestingQueue) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VestingQueue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Released { + i-- + if m.Released { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.ReleaseTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ReleaseTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintVestingQueue(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x22 + { + size, err := m.PayingCoin.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVestingQueue(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Auctioneer) > 0 { + i -= len(m.Auctioneer) + copy(dAtA[i:], m.Auctioneer) + i = encodeVarintVestingQueue(dAtA, i, uint64(len(m.Auctioneer))) + i-- + dAtA[i] = 0x12 + } + if m.AuctionId != 0 { + i = encodeVarintVestingQueue(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintVestingQueue(dAtA []byte, offset int, v uint64) int { + offset -= sovVestingQueue(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *VestingQueue) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovVestingQueue(uint64(m.AuctionId)) + } + l = len(m.Auctioneer) + if l > 0 { + n += 1 + l + sovVestingQueue(uint64(l)) + } + l = m.PayingCoin.Size() + n += 1 + l + sovVestingQueue(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ReleaseTime) + n += 1 + l + sovVestingQueue(uint64(l)) + if m.Released { + n += 2 + } + return n +} + +func sovVestingQueue(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozVestingQueue(x uint64) (n int) { + return sovVestingQueue(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *VestingQueue) 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 ErrIntOverflowVestingQueue + } + 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: VestingQueue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VestingQueue: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVestingQueue + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auctioneer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVestingQueue + } + 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 ErrInvalidLengthVestingQueue + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVestingQueue + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Auctioneer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PayingCoin", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVestingQueue + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVestingQueue + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVestingQueue + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PayingCoin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReleaseTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVestingQueue + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVestingQueue + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVestingQueue + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.ReleaseTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Released", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVestingQueue + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Released = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipVestingQueue(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthVestingQueue + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipVestingQueue(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, ErrIntOverflowVestingQueue + } + 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, ErrIntOverflowVestingQueue + } + 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, ErrIntOverflowVestingQueue + } + 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, ErrInvalidLengthVestingQueue + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupVestingQueue + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthVestingQueue + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthVestingQueue = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowVestingQueue = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupVestingQueue = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/fundraising/types/vesting_test.go b/x/fundraising/types/vesting_test.go index 77845029..40d4e405 100644 --- a/x/fundraising/types/vesting_test.go +++ b/x/fundraising/types/vesting_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + "cosmossdk.io/math" "github.com/cometbft/cometbft/crypto" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -72,7 +73,7 @@ func TestValidateVestingSchedules(t *testing.T) { { "happy case", []types.VestingSchedule{ - {ReleaseTime: types.MustParseRFC3339("9999-01-01T00:00:00Z"), Weight: sdk.MustNewDecFromStr("1.0")}, + {ReleaseTime: types.MustParseRFC3339("9999-01-01T00:00:00Z"), Weight: math.LegacyMustNewDecFromStr("1.0")}, }, types.MustParseRFC3339("2022-03-01T00:00:00Z"), "", @@ -80,7 +81,7 @@ func TestValidateVestingSchedules(t *testing.T) { { "invalid case #1", []types.VestingSchedule{ - {ReleaseTime: types.MustParseRFC3339("9999-01-01T00:00:00Z"), Weight: sdk.MustNewDecFromStr("-1.0")}, + {ReleaseTime: types.MustParseRFC3339("9999-01-01T00:00:00Z"), Weight: math.LegacyMustNewDecFromStr("-1.0")}, }, types.MustParseRFC3339("2022-03-01T00:00:00Z"), "vesting weight must be positive: invalid vesting schedules", @@ -88,7 +89,7 @@ func TestValidateVestingSchedules(t *testing.T) { { "invalid case #2", []types.VestingSchedule{ - {ReleaseTime: types.MustParseRFC3339("2022-01-01T00:00:00Z"), Weight: sdk.MustNewDecFromStr("1.0")}, + {ReleaseTime: types.MustParseRFC3339("2022-01-01T00:00:00Z"), Weight: math.LegacyMustNewDecFromStr("1.0")}, }, types.MustParseRFC3339("2022-03-01T00:00:00Z"), "release time must be set after the end time: invalid vesting schedules", @@ -96,7 +97,7 @@ func TestValidateVestingSchedules(t *testing.T) { { "invalid case #3", []types.VestingSchedule{ - {ReleaseTime: types.MustParseRFC3339("9999-01-01T00:00:00Z"), Weight: sdk.MustNewDecFromStr("2.0")}, + {ReleaseTime: types.MustParseRFC3339("9999-01-01T00:00:00Z"), Weight: math.LegacyMustNewDecFromStr("2.0")}, }, types.MustParseRFC3339("2022-03-01T00:00:00Z"), "vesting weight must not be greater than 1: invalid vesting schedules", @@ -104,10 +105,10 @@ func TestValidateVestingSchedules(t *testing.T) { { "invalid case #4", []types.VestingSchedule{ - {ReleaseTime: types.MustParseRFC3339("2022-06-01T00:00:00Z"), Weight: sdk.MustNewDecFromStr("0.25")}, - {ReleaseTime: types.MustParseRFC3339("2022-04-01T00:00:00Z"), Weight: sdk.MustNewDecFromStr("0.25")}, - {ReleaseTime: types.MustParseRFC3339("2022-09-01T00:00:00Z"), Weight: sdk.MustNewDecFromStr("0.25")}, - {ReleaseTime: types.MustParseRFC3339("2022-12-01T00:00:00Z"), Weight: sdk.MustNewDecFromStr("0.25")}, + {ReleaseTime: types.MustParseRFC3339("2022-06-01T00:00:00Z"), Weight: math.LegacyMustNewDecFromStr("0.25")}, + {ReleaseTime: types.MustParseRFC3339("2022-04-01T00:00:00Z"), Weight: math.LegacyMustNewDecFromStr("0.25")}, + {ReleaseTime: types.MustParseRFC3339("2022-09-01T00:00:00Z"), Weight: math.LegacyMustNewDecFromStr("0.25")}, + {ReleaseTime: types.MustParseRFC3339("2022-12-01T00:00:00Z"), Weight: math.LegacyMustNewDecFromStr("0.25")}, }, types.MustParseRFC3339("2022-03-01T00:00:00Z"), "release time must be chronological: invalid vesting schedules", @@ -115,10 +116,10 @@ func TestValidateVestingSchedules(t *testing.T) { { "invalid case #5", []types.VestingSchedule{ - {ReleaseTime: types.MustParseRFC3339("2022-05-01T00:00:00Z"), Weight: sdk.MustNewDecFromStr("0.5")}, - {ReleaseTime: types.MustParseRFC3339("2022-06-01T00:00:00Z"), Weight: sdk.MustNewDecFromStr("0.5")}, - {ReleaseTime: types.MustParseRFC3339("2022-07-01T00:00:00Z"), Weight: sdk.MustNewDecFromStr("0.5")}, - {ReleaseTime: types.MustParseRFC3339("2022-08-01T00:00:00Z"), Weight: sdk.MustNewDecFromStr("0.5")}, + {ReleaseTime: types.MustParseRFC3339("2022-05-01T00:00:00Z"), Weight: math.LegacyMustNewDecFromStr("0.5")}, + {ReleaseTime: types.MustParseRFC3339("2022-06-01T00:00:00Z"), Weight: math.LegacyMustNewDecFromStr("0.5")}, + {ReleaseTime: types.MustParseRFC3339("2022-07-01T00:00:00Z"), Weight: math.LegacyMustNewDecFromStr("0.5")}, + {ReleaseTime: types.MustParseRFC3339("2022-08-01T00:00:00Z"), Weight: math.LegacyMustNewDecFromStr("0.5")}, }, types.MustParseRFC3339("2022-03-01T00:00:00Z"), "total vesting weight must be equal to 1: invalid vesting schedules",