From 5b7fc8ae90a74f9ed66a7391caa760046dace373 Mon Sep 17 00:00:00 2001 From: Troy Date: Thu, 31 Oct 2024 21:21:46 +0100 Subject: [PATCH 01/10] docs: redirect the remote generation page (#22404) --- docs/architecture/adr-054-semver-compatible-modules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/architecture/adr-054-semver-compatible-modules.md b/docs/architecture/adr-054-semver-compatible-modules.md index 40dd60810633..88132e7773ae 100644 --- a/docs/architecture/adr-054-semver-compatible-modules.md +++ b/docs/architecture/adr-054-semver-compatible-modules.md @@ -370,7 +370,7 @@ approach described in approach A. Either way, types implementing interfaces woul with an `InterfaceRegistry` as they are now because there would be no way to retrieve them via the global registry. In order to simplify access to other modules using ADR 033, a public API module (maybe even one -[remotely generated by Buf](https://docs.buf.build/bsr/remote-generation/go)) could be used by client modules instead +[remotely generated by Buf](https://buf.build/docs/migration-guides/migrate-remote-generation-alpha)) could be used by client modules instead of requiring to generate all client types internally. The big downsides of this approach are that it requires big changes to how people use protobuf types and would be a From 838f1557af0adf2f37bb620027a07bc843eb1978 Mon Sep 17 00:00:00 2001 From: Hwangjae Lee Date: Mon, 4 Nov 2024 17:42:51 +0900 Subject: [PATCH 02/10] docs: Update Twitter Links to X in Documentation (#22408) Signed-off-by: Hwangjae Lee --- docs/build/building-apps/04-security-part-1.md | 2 +- x/staking/README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/build/building-apps/04-security-part-1.md b/docs/build/building-apps/04-security-part-1.md index bdda5c1e260d..65090f38ff35 100644 --- a/docs/build/building-apps/04-security-part-1.md +++ b/docs/build/building-apps/04-security-part-1.md @@ -1,6 +1,6 @@ # The Cosmos Security Handbook: Part 1 - Core Chain -> Thank you to **[Roman Akhtariev](https://twitter.com/akhtariev) and [Alpin Yukseloglu](https://twitter.com/0xalpo)** for authoring this post. The original post can be found [here](https://www.faulttolerant.xyz/2024-01-16-cosmos-security-1/). +> Thank you to **[Roman Akhtariev](https://x.com/akhtariev) and [Alpin Yukseloglu](https://x.com/0xalpo)** for authoring this post. The original post can be found [here](https://www.faulttolerant.xyz/2024-01-16-cosmos-security-1/). > [Trail of bits](https://www.trailofbits.com/) hosts another set of guidelines [here](https://github.com/crytic/building-secure-contracts/tree/master/not-so-smart-contracts/cosmos) diff --git a/x/staking/README.md b/x/staking/README.md index e09065481d86..45c204041b88 100644 --- a/x/staking/README.md +++ b/x/staking/README.md @@ -2481,7 +2481,7 @@ Example Output: "description": { "moniker": "jabbey", "identity": "", - "website": "https://twitter.com/JoeAbbey", + "website": "https://x.com/JoeAbbey", "security_contact": "", "details": "just another dad in the cosmos" }, @@ -2538,7 +2538,7 @@ Example Output: "description": { "moniker": "jabbey", "identity": "", - "website": "https://twitter.com/JoeAbbey", + "website": "https://x.com/JoeAbbey", "security_contact": "", "details": "just another dad in the cosmos" }, From 80402e7dce72c05aab53d01461495833ee3aa922 Mon Sep 17 00:00:00 2001 From: Eric Mokaya <4112301+ziscky@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:17:28 +0300 Subject: [PATCH 03/10] feat(baseapp): add per message telemetry (#22175) --- CHANGELOG.md | 1 + baseapp/baseapp.go | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6d9cc8c6a55..7d88d88ad2d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -89,6 +89,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * (x/validate) [#21822](https://github.com/cosmos/cosmos-sdk/pull/21822) New module solely responsible for providing ante/post handlers and tx validators for v2. It can be extended by the app developer to provide extra tx validators. * In comparison to x/auth/tx/config, there is no app config to skip ante/post handlers, as overwriting them in baseapp or not injecting the x/validate module has the same effect. * (baseapp) [#21979](https://github.com/cosmos/cosmos-sdk/pull/21979) Create CheckTxHandler to allow extending the logic of CheckTx. +* (baseapp) [[#13981](https://github.com/cosmos/cosmos-sdk/issues/13981)] Add per-message telemetry. ### Improvements diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 4d51fea669b7..98adf6e1a94e 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -1030,13 +1030,14 @@ func (app *BaseApp) runTx(mode execMode, txBytes []byte, tx sdk.Tx) (gInfo sdk.G func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, reflectMsgs []protoreflect.Message, mode execMode) (*sdk.Result, error) { events := sdk.EmptyEvents() msgResponses := make([]*codectypes.Any, 0, len(msgs)) - // NOTE: GasWanted is determined by the AnteHandler and GasUsed by the GasMeter. for i, msg := range msgs { if mode != execModeFinalize && mode != execModeSimulate { break } + start := telemetry.Now() + handler := app.msgServiceRouter.Handler(msg) if handler == nil { return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "no message handler found for %T", msg) @@ -1076,6 +1077,8 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, reflectMsgs []proto } msgResponses = append(msgResponses, msgResponse) } + + telemetry.MeasureSince(start, "tx", "msg", "processing_time", sdk.MsgTypeURL(msg)) } data, err := makeABCIData(msgResponses) From 3ba4661dc7cf9a3ee6517764d6b0b5c7268ed33c Mon Sep 17 00:00:00 2001 From: Eric Mokaya <4112301+ziscky@users.noreply.github.com> Date: Mon, 4 Nov 2024 19:04:56 +0300 Subject: [PATCH 04/10] docs: Module account address documentation (#22289) --- docs/learn/beginner/03-accounts.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/learn/beginner/03-accounts.md b/docs/learn/beginner/03-accounts.md index 99c9b30267f8..3d626f0d2d56 100644 --- a/docs/learn/beginner/03-accounts.md +++ b/docs/learn/beginner/03-accounts.md @@ -95,6 +95,26 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.2/codec/address/bech32_co | Validator Operator | cosmosvaloper | | Consensus Nodes | cosmosvalcons | + +### Module Accounts + +Module accounts are special accounts used by modules to perform specific operations within the blockchain. These accounts are not controlled by users but by the modules themselves. Each module account has a unique name and a set of permissions that define what operations it can perform. Examples of module accounts include the distribution module account, which handles the distribution of staking rewards and the governance module account, which manages the funds related to governance proposals. + + +#### Address Generation + +Module account addresses are generated deterministically from the module name, as defined in [ADR-028](../../architecture/adr-028-public-key-addresses.md) + +Definition of account permissions is done during the app initialization. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/3a03804c148d0da8d6df1ad839b08c50f6896fa1/simapp/app.go#L130-L141 +``` + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/3a03804c148d0da8d6df1ad839b08c50f6896fa1/simapp/app.go#L328 +``` + ### Public Keys Public keys in Cosmos SDK are defined by `cryptotypes.PubKey` interface. Since public keys are saved in a store, the `cryptotypes.PubKey` extends the `proto.Message` interface: From e0f644beb972b47fe181952676e32d0ee05880e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 19:54:49 +0000 Subject: [PATCH 05/10] build(deps): Bump github.com/fsnotify/fsnotify from 1.7.0 to 1.8.0 in /tools/cosmovisor (#22407) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] Co-authored-by: Julien Robert --- .github/workflows/test.yml | 8 -------- client/v2/go.mod | 4 ++-- client/v2/go.sum | 8 ++++---- collections/protocodec/go.mod | 4 ++-- collections/protocodec/go.sum | 8 ++++---- go.mod | 2 +- go.sum | 4 ++-- orm/go.mod | 4 ++-- orm/go.sum | 9 ++++----- runtime/v2/go.sum | 4 ++-- server/v2/cometbft/go.mod | 2 +- server/v2/cometbft/go.sum | 4 ++-- server/v2/go.mod | 2 +- server/v2/go.sum | 4 ++-- simapp/go.mod | 4 ++-- simapp/go.sum | 4 ++-- simapp/v2/go.mod | 4 ++-- simapp/v2/go.sum | 4 ++-- store/v2/go.mod | 2 +- store/v2/go.sum | 4 ++-- tests/go.mod | 4 ++-- tests/go.sum | 4 ++-- tests/systemtests/go.mod | 2 +- tests/systemtests/go.sum | 4 ++-- tools/confix/go.mod | 2 +- tools/confix/go.sum | 4 ++-- tools/cosmovisor/go.mod | 2 +- tools/cosmovisor/go.sum | 4 ++-- tools/hubl/go.mod | 2 +- tools/hubl/go.sum | 4 ++-- x/accounts/defaults/base/go.mod | 2 +- x/accounts/defaults/base/go.sum | 4 ++-- x/accounts/defaults/lockup/go.mod | 2 +- x/accounts/defaults/lockup/go.sum | 4 ++-- x/accounts/defaults/multisig/go.mod | 2 +- x/accounts/defaults/multisig/go.sum | 4 ++-- x/accounts/go.mod | 2 +- x/accounts/go.sum | 4 ++-- x/authz/go.mod | 2 +- x/authz/go.sum | 4 ++-- x/bank/go.mod | 2 +- x/bank/go.sum | 4 ++-- x/circuit/go.mod | 2 +- x/circuit/go.sum | 4 ++-- x/consensus/go.mod | 2 +- x/consensus/go.sum | 4 ++-- x/distribution/go.mod | 2 +- x/distribution/go.sum | 4 ++-- x/epochs/go.mod | 2 +- x/epochs/go.sum | 4 ++-- x/evidence/go.mod | 2 +- x/evidence/go.sum | 4 ++-- x/feegrant/go.mod | 2 +- x/feegrant/go.sum | 4 ++-- x/gov/go.mod | 2 +- x/gov/go.sum | 4 ++-- x/group/go.mod | 2 +- x/group/go.sum | 4 ++-- x/mint/go.mod | 2 +- x/mint/go.sum | 4 ++-- x/nft/go.mod | 2 +- x/nft/go.sum | 4 ++-- x/params/go.mod | 2 +- x/params/go.sum | 4 ++-- x/protocolpool/go.mod | 2 +- x/protocolpool/go.sum | 4 ++-- x/slashing/go.mod | 2 +- x/slashing/go.sum | 4 ++-- x/staking/go.mod | 2 +- x/staking/go.sum | 4 ++-- x/upgrade/go.mod | 2 +- x/upgrade/go.sum | 4 ++-- 72 files changed, 119 insertions(+), 128 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b1762032c33b..ff9f72c16038 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -626,14 +626,6 @@ jobs: run: | cd collections/protocodec go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: collections/protocodec test-orm: runs-on: ubuntu-latest diff --git a/client/v2/go.mod b/client/v2/go.mod index 46ffa46d19d4..b1b709154c1d 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -23,7 +23,7 @@ require ( require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.1-20240701160653-fedbb9acfd2f.1 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.35.1-20240130113600-88ef6483f90f.1 // indirect - cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/collections v0.4.1-0.20241104084251-838f1557af0a // indirect cosmossdk.io/core/testing v0.0.0-20240923163230-04da382a9f29 // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/log v1.4.1 // indirect @@ -70,7 +70,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/client/v2/go.sum b/client/v2/go.sum index 840cb42b9f38..a8bd0b7d3a18 100644 --- a/client/v2/go.sum +++ b/client/v2/go.sum @@ -4,8 +4,8 @@ buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.35.1-20240130113600-88e buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.35.1-20240130113600-88ef6483f90f.1/go.mod h1:zqi/LZjZhyvjCMTEVIwAf5VRlkLduuCfqmZxgoormq0= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= -cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/collections v0.4.1-0.20241104084251-838f1557af0a h1:9DxUD+82dO3c+R3XqwW+a7i4nVLiN6I0g2rp2rLOh7E= +cosmossdk.io/collections v0.4.1-0.20241104084251-838f1557af0a/go.mod h1:DcD++Yfcq0OFtM3CJNYLIBjfZ+4DEyeJ/AUk6gkwlOE= cosmossdk.io/core v1.0.0-alpha.5 h1:McjYXAQ6XcT20v2uHyH7PhoWH8V+mebzfVFqT3GinsI= cosmossdk.io/core v1.0.0-alpha.5/go.mod h1:3u9cWq1FAVtiiCrDPpo4LhR+9V6k/ycSG4/Y/tREWCY= cosmossdk.io/core/testing v0.0.0-20240923163230-04da382a9f29 h1:NxxUo0GMJUbIuVg0R70e3cbn9eFTEuMr7ev1AFvypdY= @@ -180,8 +180,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/collections/protocodec/go.mod b/collections/protocodec/go.mod index 69040e046041..265d6403c748 100644 --- a/collections/protocodec/go.mod +++ b/collections/protocodec/go.mod @@ -24,7 +24,7 @@ require ( github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.4 // indirect @@ -46,7 +46,7 @@ require ( github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/collections/protocodec/go.sum b/collections/protocodec/go.sum index fc3bee6b5be5..8f599ceb47d1 100644 --- a/collections/protocodec/go.sum +++ b/collections/protocodec/go.sum @@ -39,8 +39,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= @@ -169,8 +169,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/go.mod b/go.mod index daeab6e96816..1fa88112b32c 100644 --- a/go.mod +++ b/go.mod @@ -95,7 +95,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/go.sum b/go.sum index ca8c3fd1f0ec..dcf09e6b2575 100644 --- a/go.sum +++ b/go.sum @@ -168,8 +168,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk 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.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/orm/go.mod b/orm/go.mod index a0a5d522fcf0..e711a8b5f7d1 100644 --- a/orm/go.mod +++ b/orm/go.mod @@ -39,7 +39,7 @@ require ( github.com/cucumber/messages/go/v22 v22.0.0 // indirect github.com/cucumber/tag-expressions/go/v6 v6.1.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect github.com/gofrs/uuid v4.4.0+incompatible // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -64,7 +64,7 @@ require ( github.com/tendermint/go-amino v0.16.0 // indirect github.com/tidwall/btree v1.7.0 // indirect golang.org/x/net v0.29.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.18.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f // indirect diff --git a/orm/go.sum b/orm/go.sum index ec80bb604aac..65c2db9d6a72 100644 --- a/orm/go.sum +++ b/orm/go.sum @@ -57,8 +57,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= @@ -208,9 +208,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/runtime/v2/go.sum b/runtime/v2/go.sum index cdf94ffd213b..c56de5b9d391 100644 --- a/runtime/v2/go.sum +++ b/runtime/v2/go.sum @@ -66,8 +66,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= diff --git a/server/v2/cometbft/go.mod b/server/v2/cometbft/go.mod index e582690cd789..ccc8de2d3e16 100644 --- a/server/v2/cometbft/go.mod +++ b/server/v2/cometbft/go.mod @@ -86,7 +86,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/server/v2/cometbft/go.sum b/server/v2/cometbft/go.sum index 0fcabe91037e..e381294209fc 100644 --- a/server/v2/cometbft/go.sum +++ b/server/v2/cometbft/go.sum @@ -174,8 +174,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/server/v2/go.mod b/server/v2/go.mod index 1e2e76342465..0331cd942b46 100644 --- a/server/v2/go.mod +++ b/server/v2/go.mod @@ -58,7 +58,7 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect diff --git a/server/v2/go.sum b/server/v2/go.sum index c35326ca5bbf..4ea1c4e1b328 100644 --- a/server/v2/go.sum +++ b/server/v2/go.sum @@ -93,8 +93,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/simapp/go.mod b/simapp/go.mod index 96e451a955e7..bb3eb06a565e 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -5,7 +5,7 @@ go 1.23.1 require ( cosmossdk.io/api v0.7.6 cosmossdk.io/client/v2 v2.0.0-20230630094428-02b760776860 - cosmossdk.io/collections v0.4.0 + cosmossdk.io/collections v0.4.1-0.20241104084251-838f1557af0a cosmossdk.io/core v1.0.0-alpha.5 cosmossdk.io/core/testing v0.0.0-20240923163230-04da382a9f29 cosmossdk.io/depinject v1.0.0 @@ -104,7 +104,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/simapp/go.sum b/simapp/go.sum index 753a95f0dcf5..0a415935f1f8 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -391,8 +391,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk 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.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index 0e803ed0f86d..ef88fcec0440 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -57,7 +57,7 @@ require ( cloud.google.com/go/compute/metadata v0.5.0 // indirect cloud.google.com/go/iam v1.1.13 // indirect cloud.google.com/go/storage v1.43.0 // indirect - cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/collections v0.4.1-0.20241104084251-838f1557af0a // indirect cosmossdk.io/core/testing v0.0.0-20240923163230-04da382a9f29 // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/errors/v2 v2.0.0-20240731132947-df72853b3ca5 // indirect @@ -112,7 +112,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/simapp/v2/go.sum b/simapp/v2/go.sum index beee381cb4ec..4d66c383748f 100644 --- a/simapp/v2/go.sum +++ b/simapp/v2/go.sum @@ -393,8 +393,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk 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.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/store/v2/go.mod b/store/v2/go.mod index f906dfb1c4b2..79fe623e278e 100644 --- a/store/v2/go.mod +++ b/store/v2/go.mod @@ -34,7 +34,7 @@ require ( github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/dot v1.6.2 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.4 // indirect diff --git a/store/v2/go.sum b/store/v2/go.sum index e0f9db427cea..9e18be21fa29 100644 --- a/store/v2/go.sum +++ b/store/v2/go.sum @@ -60,8 +60,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= diff --git a/tests/go.mod b/tests/go.mod index a98402d39de5..5ad97cc1d0bc 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -4,7 +4,7 @@ go 1.23.1 require ( cosmossdk.io/api v0.7.6 - cosmossdk.io/collections v0.4.0 + cosmossdk.io/collections v0.4.1-0.20241104084251-838f1557af0a cosmossdk.io/core v1.0.0-alpha.5 cosmossdk.io/depinject v1.0.0 cosmossdk.io/log v1.4.1 @@ -109,7 +109,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/tests/go.sum b/tests/go.sum index 6e624911ccd2..e26179dd6cda 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -384,8 +384,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/tests/systemtests/go.mod b/tests/systemtests/go.mod index 9c5a0c17f730..e5f1a1f93e0b 100644 --- a/tests/systemtests/go.mod +++ b/tests/systemtests/go.mod @@ -74,7 +74,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/tests/systemtests/go.sum b/tests/systemtests/go.sum index 7232a393bde0..da77593ee370 100644 --- a/tests/systemtests/go.sum +++ b/tests/systemtests/go.sum @@ -228,8 +228,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/tools/confix/go.mod b/tools/confix/go.mod index 47ae673fb289..8ee1923db41e 100644 --- a/tools/confix/go.mod +++ b/tools/confix/go.mod @@ -62,7 +62,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/tools/confix/go.sum b/tools/confix/go.sum index 193080cfdb06..92d56e555cff 100644 --- a/tools/confix/go.sum +++ b/tools/confix/go.sum @@ -231,8 +231,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/tools/cosmovisor/go.mod b/tools/cosmovisor/go.mod index 48154be2187f..3947e67e83d5 100644 --- a/tools/cosmovisor/go.mod +++ b/tools/cosmovisor/go.mod @@ -6,7 +6,7 @@ require ( cosmossdk.io/log v1.4.1 cosmossdk.io/x/upgrade v0.1.4 github.com/cosmos/cosmos-sdk v0.50.10 - github.com/fsnotify/fsnotify v1.7.0 + github.com/fsnotify/fsnotify v1.8.0 github.com/otiai10/copy v1.14.0 github.com/pelletier/go-toml/v2 v2.2.3 github.com/spf13/cobra v1.8.1 diff --git a/tools/cosmovisor/go.sum b/tools/cosmovisor/go.sum index 5c997f7804df..808cdebbe509 100644 --- a/tools/cosmovisor/go.sum +++ b/tools/cosmovisor/go.sum @@ -405,8 +405,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.28.0 h1:7Rqx9M3ythTKy2J6uZLHmc8Sz9OGgIlseuO1iBX/s0M= github.com/getsentry/sentry-go v0.28.0/go.mod h1:1fQZ+7l7eeJ3wYi82q5Hg8GqAPgefRq+FP/QhafYVgg= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/tools/hubl/go.mod b/tools/hubl/go.mod index 98daa924a6cf..f3768da0b4db 100644 --- a/tools/hubl/go.mod +++ b/tools/hubl/go.mod @@ -63,7 +63,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/tools/hubl/go.sum b/tools/hubl/go.sum index 34ada5b5b36d..e3867e5769de 100644 --- a/tools/hubl/go.sum +++ b/tools/hubl/go.sum @@ -231,8 +231,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/accounts/defaults/base/go.mod b/x/accounts/defaults/base/go.mod index 583b3566a4ea..8c48af24a5bf 100644 --- a/x/accounts/defaults/base/go.mod +++ b/x/accounts/defaults/base/go.mod @@ -64,7 +64,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/accounts/defaults/base/go.sum b/x/accounts/defaults/base/go.sum index 0f35d51f6fa0..cd9371822af4 100644 --- a/x/accounts/defaults/base/go.sum +++ b/x/accounts/defaults/base/go.sum @@ -170,8 +170,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/accounts/defaults/lockup/go.mod b/x/accounts/defaults/lockup/go.mod index 27a9f2c75618..d261f5672a0b 100644 --- a/x/accounts/defaults/lockup/go.mod +++ b/x/accounts/defaults/lockup/go.mod @@ -57,7 +57,7 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/emicklei/dot v1.6.2 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/accounts/defaults/lockup/go.sum b/x/accounts/defaults/lockup/go.sum index cfc3d316eda8..c6ace37c13b6 100644 --- a/x/accounts/defaults/lockup/go.sum +++ b/x/accounts/defaults/lockup/go.sum @@ -142,8 +142,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/accounts/defaults/multisig/go.mod b/x/accounts/defaults/multisig/go.mod index 2806370ee198..f7d8659b157b 100644 --- a/x/accounts/defaults/multisig/go.mod +++ b/x/accounts/defaults/multisig/go.mod @@ -64,7 +64,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/accounts/defaults/multisig/go.sum b/x/accounts/defaults/multisig/go.sum index 0f35d51f6fa0..cd9371822af4 100644 --- a/x/accounts/defaults/multisig/go.sum +++ b/x/accounts/defaults/multisig/go.sum @@ -170,8 +170,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/accounts/go.mod b/x/accounts/go.mod index 1a3ed9587264..16e2c6ef3c1d 100644 --- a/x/accounts/go.mod +++ b/x/accounts/go.mod @@ -69,7 +69,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/accounts/go.sum b/x/accounts/go.sum index 0f35d51f6fa0..cd9371822af4 100644 --- a/x/accounts/go.sum +++ b/x/accounts/go.sum @@ -170,8 +170,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/authz/go.mod b/x/authz/go.mod index 7ba6f70ba494..1e34eb17d8be 100644 --- a/x/authz/go.mod +++ b/x/authz/go.mod @@ -66,7 +66,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/authz/go.sum b/x/authz/go.sum index 0f35d51f6fa0..cd9371822af4 100644 --- a/x/authz/go.sum +++ b/x/authz/go.sum @@ -170,8 +170,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/bank/go.mod b/x/bank/go.mod index 8f3ff02f12b1..984ef646b580 100644 --- a/x/bank/go.mod +++ b/x/bank/go.mod @@ -66,7 +66,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/bank/go.sum b/x/bank/go.sum index 0f35d51f6fa0..cd9371822af4 100644 --- a/x/bank/go.sum +++ b/x/bank/go.sum @@ -170,8 +170,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/circuit/go.mod b/x/circuit/go.mod index 8756e26d5ba3..54a731e78ffe 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -66,7 +66,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/circuit/go.sum b/x/circuit/go.sum index d535cd725fc9..8fceb55731a7 100644 --- a/x/circuit/go.sum +++ b/x/circuit/go.sum @@ -172,8 +172,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/consensus/go.mod b/x/consensus/go.mod index 89e2f6d9cb09..d12915607923 100644 --- a/x/consensus/go.mod +++ b/x/consensus/go.mod @@ -66,7 +66,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/consensus/go.sum b/x/consensus/go.sum index d535cd725fc9..8fceb55731a7 100644 --- a/x/consensus/go.sum +++ b/x/consensus/go.sum @@ -172,8 +172,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/distribution/go.mod b/x/distribution/go.mod index 05372fa90a99..7ee993aae9f4 100644 --- a/x/distribution/go.mod +++ b/x/distribution/go.mod @@ -69,7 +69,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/distribution/go.sum b/x/distribution/go.sum index 0f35d51f6fa0..cd9371822af4 100644 --- a/x/distribution/go.sum +++ b/x/distribution/go.sum @@ -170,8 +170,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/epochs/go.mod b/x/epochs/go.mod index 90f72e1109ad..284e7f2deab2 100644 --- a/x/epochs/go.mod +++ b/x/epochs/go.mod @@ -66,7 +66,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/epochs/go.sum b/x/epochs/go.sum index d535cd725fc9..8fceb55731a7 100644 --- a/x/epochs/go.sum +++ b/x/epochs/go.sum @@ -172,8 +172,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/evidence/go.mod b/x/evidence/go.mod index 3483f37956ad..4de7e8a97cf8 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -69,7 +69,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/evidence/go.sum b/x/evidence/go.sum index d535cd725fc9..8fceb55731a7 100644 --- a/x/evidence/go.sum +++ b/x/evidence/go.sum @@ -172,8 +172,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index 67e20a2a6def..959204ea7189 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -77,7 +77,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/feegrant/go.sum b/x/feegrant/go.sum index 3b4e589acd78..efdf24e13ba5 100644 --- a/x/feegrant/go.sum +++ b/x/feegrant/go.sum @@ -178,8 +178,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/gov/go.mod b/x/gov/go.mod index 80be4bd43ad7..1de77256af1e 100644 --- a/x/gov/go.mod +++ b/x/gov/go.mod @@ -73,7 +73,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/gov/go.sum b/x/gov/go.sum index 41729611ac1d..4e6d843a385a 100644 --- a/x/gov/go.sum +++ b/x/gov/go.sum @@ -176,8 +176,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/group/go.mod b/x/group/go.mod index 807a3ee6316f..5c0a41a54ada 100644 --- a/x/group/go.mod +++ b/x/group/go.mod @@ -79,7 +79,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/group/go.sum b/x/group/go.sum index bc6f40b75f38..827315f69da4 100644 --- a/x/group/go.sum +++ b/x/group/go.sum @@ -178,8 +178,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/mint/go.mod b/x/mint/go.mod index 037e259b420d..5780be9ba0aa 100644 --- a/x/mint/go.mod +++ b/x/mint/go.mod @@ -66,7 +66,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/mint/go.sum b/x/mint/go.sum index d535cd725fc9..8fceb55731a7 100644 --- a/x/mint/go.sum +++ b/x/mint/go.sum @@ -172,8 +172,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/nft/go.mod b/x/nft/go.mod index fe2b0686cc96..a07aafaacf3a 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -67,7 +67,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/nft/go.sum b/x/nft/go.sum index d535cd725fc9..8fceb55731a7 100644 --- a/x/nft/go.sum +++ b/x/nft/go.sum @@ -172,8 +172,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/params/go.mod b/x/params/go.mod index 3a98f4369c81..c4d16f371bda 100644 --- a/x/params/go.mod +++ b/x/params/go.mod @@ -66,7 +66,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/params/go.sum b/x/params/go.sum index 73f87a32b18f..4c27f0ad454a 100644 --- a/x/params/go.sum +++ b/x/params/go.sum @@ -158,8 +158,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/protocolpool/go.mod b/x/protocolpool/go.mod index 5b1f53b294b9..ce68008aadb4 100644 --- a/x/protocolpool/go.mod +++ b/x/protocolpool/go.mod @@ -68,7 +68,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/protocolpool/go.sum b/x/protocolpool/go.sum index d535cd725fc9..8fceb55731a7 100644 --- a/x/protocolpool/go.sum +++ b/x/protocolpool/go.sum @@ -172,8 +172,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/slashing/go.mod b/x/slashing/go.mod index e6aadcf88add..b08e4a964bac 100644 --- a/x/slashing/go.mod +++ b/x/slashing/go.mod @@ -70,7 +70,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/slashing/go.sum b/x/slashing/go.sum index ef6a4385622d..58ca35c37a24 100644 --- a/x/slashing/go.sum +++ b/x/slashing/go.sum @@ -174,8 +174,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/staking/go.mod b/x/staking/go.mod index 47b7b3420730..fac99dfe7a4b 100644 --- a/x/staking/go.mod +++ b/x/staking/go.mod @@ -63,7 +63,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/staking/go.sum b/x/staking/go.sum index 0f35d51f6fa0..cd9371822af4 100644 --- a/x/staking/go.sum +++ b/x/staking/go.sum @@ -170,8 +170,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index 38a9b7aa420b..6f2aedce1541 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -84,7 +84,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/upgrade/go.sum b/x/upgrade/go.sum index ec36d8af32c2..829d69c67197 100644 --- a/x/upgrade/go.sum +++ b/x/upgrade/go.sum @@ -384,8 +384,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= From e9436a6a1b53d32dc4c8e62dbcb8b858f1b88d1c Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 5 Nov 2024 11:38:08 +0400 Subject: [PATCH 06/10] docs: update ADR 59 (#22423) --- docs/architecture/adr-059-test-scopes.md | 27 +++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/docs/architecture/adr-059-test-scopes.md b/docs/architecture/adr-059-test-scopes.md index cb1263443bcc..c8d126a0d170 100644 --- a/docs/architecture/adr-059-test-scopes.md +++ b/docs/architecture/adr-059-test-scopes.md @@ -5,10 +5,11 @@ * 2022-08-02: Initial Draft * 2023-03-02: Add precision for integration tests * 2023-03-23: Add precision for E2E tests +* 2024-11-04: Update E2E mention by system tests ## Status -PROPOSED Partially Implemented +PROPOSED Implemented ## Abstract @@ -141,9 +142,13 @@ Modules not returning simulation operations: ### E2E tests +:::note +End-to-end tests have been removed from v0.52+ and have been replaced fully by system tests. +::: + End to end tests exercise the entire system as we understand it in as close an approximation to a production environment as is practical. Presently these tests are located at -[tests/e2e](https://github.com/cosmos/cosmos-sdk/tree/main/tests/e2e) and rely on [testutil/network](https://github.com/cosmos/cosmos-sdk/tree/main/testutil/network) to start up an in-process Tendermint node. +[tests/e2e](https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/tests/e2e) and rely on [testutil/network](https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/testutil/network) to start up an in-process Tendermint node. An application should be built as minimally as possible to exercise the desired functionality. The SDK uses an application will only the required modules for the tests. The application developer is advised to use its own application for e2e tests. @@ -168,7 +173,7 @@ We accept these test scopes and identify the following decisions points for each | Unit | None | Yes | | Integration | integration helpers | Some | | Simulation | minimal app | No | -| E2E | minimal app | No | +| System Test | full app | No | The decision above is valid for the SDK. An application developer should test their application with their full application instead of the minimal app. @@ -205,16 +210,14 @@ Simulations shall use a minimal application (usually via app wiring). They are l ### E2E Tests -Existing e2e tests shall be migrated to integration tests by removing the dependency on the -test network and in-process Tendermint node to ensure we do not lose test coverage. - -The e2e rest runner shall transition from in process Tendermint to a runner powered by -Docker via [dockertest](https://github.com/ory/dockertest). +:::note +End-to-end tests have been removed from v0.52+ and have been replaced fully by system tests. +::: -E2E tests exercising a full network upgrade shall be written. +Existing E2E tests have been removed from the SDK and migrated to [system tests](https://github.com/cosmos/cosmos-sdk/issues/20800). System tests are running for v0.xx applications and v2 applications. +They ensure that the application, CLI, and REST API are working as expected on both v0.xx and v2 applications. -The CLI testing aspect of existing e2e tests shall be rewritten using the network mocking -demonstrated in [PR#12706](https://github.com/cosmos/cosmos-sdk/pull/12706). +Learn more about system tests [here](https://github.com/cosmos/cosmos-sdk/blob/main/tests/systemtests/README.md). ## Consequences @@ -234,7 +237,7 @@ demonstrated in [PR#12706](https://github.com/cosmos/cosmos-sdk/pull/12706). ### Neutral -* some discovery required for e2e transition to dockertest +* ~~some discovery required for e2e transition to dockertest~~ (e2e tests have been migrated to system tests) ## Further Discussions From 55f7cfcebae4511ba12049b510eb6539e490da2d Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Tue, 5 Nov 2024 14:39:32 +0700 Subject: [PATCH 07/10] refactor(serevr/v2/cometbft): update `RegisterQueryHandlers` and GRPC queries (#22403) --- runtime/v2/manager.go | 13 ++++++++++--- server/v2/cometbft/abci.go | 9 ++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/runtime/v2/manager.go b/runtime/v2/manager.go index e2e90c27f808..9e99a2b08c4f 100644 --- a/runtime/v2/manager.go +++ b/runtime/v2/manager.go @@ -642,7 +642,7 @@ func registerServices[T transaction.Tx](s appmodulev2.AppModule, app *App[T], re // if module implements register msg handlers if module, ok := s.(appmodulev2.HasMsgHandlers); ok { - wrapper := stfRouterWrapper{stfRouter: app.msgRouterBuilder} + wrapper := newStfRouterWrapper(app.msgRouterBuilder) module.RegisterMsgHandlers(&wrapper) if wrapper.error != nil { return fmt.Errorf("unable to register handlers: %w", wrapper.error) @@ -651,7 +651,7 @@ func registerServices[T transaction.Tx](s appmodulev2.AppModule, app *App[T], re // if module implements register query handlers if module, ok := s.(appmodulev2.HasQueryHandlers); ok { - wrapper := stfRouterWrapper{stfRouter: app.queryRouterBuilder} + wrapper := newStfRouterWrapper(app.queryRouterBuilder) module.RegisterQueryHandlers(&wrapper) for path, handler := range wrapper.handlers { @@ -842,6 +842,13 @@ type stfRouterWrapper struct { handlers map[string]appmodulev2.Handler } +func newStfRouterWrapper(stfRouterBuilder *stf.MsgRouterBuilder) stfRouterWrapper { + wrapper := stfRouterWrapper{stfRouter: stfRouterBuilder} + wrapper.error = nil + wrapper.handlers = map[string]appmodulev2.Handler{} + return wrapper +} + func (s *stfRouterWrapper) RegisterHandler(handler appmodulev2.Handler) { req := handler.MakeMsg() requestName := gogoproto.MessageName(req) @@ -854,7 +861,7 @@ func (s *stfRouterWrapper) RegisterHandler(handler appmodulev2.Handler) { s.error = errors.Join(s.error, err) // also make the decoder - if s.error == nil { + if s.handlers == nil { s.handlers = map[string]appmodulev2.Handler{} } s.handlers[requestName] = handler diff --git a/server/v2/cometbft/abci.go b/server/v2/cometbft/abci.go index 5daf0c103038..45a5be69da89 100644 --- a/server/v2/cometbft/abci.go +++ b/server/v2/cometbft/abci.go @@ -259,12 +259,15 @@ func (c *Consensus[T]) maybeRunGRPCQuery(ctx context.Context, req *abci.QueryReq return nil, false, err } + var handlerFullName string md, isGRPC := desc.(protoreflect.MethodDescriptor) if !isGRPC { - return nil, false, nil + handlerFullName = string(desc.FullName()) + } else { + handlerFullName = string(md.Input().FullName()) } - handler, found := c.queryHandlersMap[string(md.Input().FullName())] + handler, found := c.queryHandlersMap[handlerFullName] if !found { return nil, true, fmt.Errorf("no query handler found for %s", req.Path) } @@ -282,7 +285,7 @@ func (c *Consensus[T]) maybeRunGRPCQuery(ctx context.Context, req *abci.QueryReq } resp, err = queryResponse(res, req.Height) - return resp, isGRPC, err + return resp, true, err } // InitChain implements types.Application. From 8c24b6bef1f7480314aaade52f6b2154413856f2 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 5 Nov 2024 13:02:47 +0400 Subject: [PATCH 08/10] fix(x/group): proper address rendering in error (#22425) --- x/group/keeper/proposal_executor.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/x/group/keeper/proposal_executor.go b/x/group/keeper/proposal_executor.go index 4ecef52d1927..24d372daca3b 100644 --- a/x/group/keeper/proposal_executor.go +++ b/x/group/keeper/proposal_executor.go @@ -70,7 +70,13 @@ func ensureMsgAuthZ(msgs []sdk.Msg, groupPolicyAcc sdk.AccAddress, cdc codec.Cod if err != nil { return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "msg does not have group policy authorization; error retrieving group policy address") } - return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "msg does not have group policy authorization; expected %s, got %s", groupPolicyAddr, acct) + + acctStr, _ := addressCodec.BytesToString(acct) + if acctStr == "" { + acctStr = "unmarshalable address" + } + + return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "msg does not have group policy authorization; expected %s, got %s", groupPolicyAddr, acctStr) } } } From 62ddd3e9397b40b51d3dba311c7e78abcfd38636 Mon Sep 17 00:00:00 2001 From: Randy Grok <98407738+randygrok@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:31:22 +0100 Subject: [PATCH 09/10] feat: wire new handlers to grpc (#22333) Co-authored-by: Randy Grok <@faulttolerance.net> Co-authored-by: Julien Robert --- api/cosmos/base/grpc/v2/service.pulsar.go | 2590 ++++++++++++++++++++ api/cosmos/base/grpc/v2/service_grpc.pb.go | 167 ++ proto/cosmos/base/grpc/v2/service.proto | 39 + server/v2/api/grpc/server.go | 3 + server/v2/api/grpc/service.go | 73 + server/v2/api/grpc/service.pb.go | 1167 +++++++++ server/v2/api/grpc/service_test.go | 227 ++ server/v2/go.mod | 2 + server/v2/go.sum | 8 + 9 files changed, 4276 insertions(+) create mode 100644 api/cosmos/base/grpc/v2/service.pulsar.go create mode 100644 api/cosmos/base/grpc/v2/service_grpc.pb.go create mode 100644 proto/cosmos/base/grpc/v2/service.proto create mode 100644 server/v2/api/grpc/service.go create mode 100644 server/v2/api/grpc/service.pb.go create mode 100644 server/v2/api/grpc/service_test.go diff --git a/api/cosmos/base/grpc/v2/service.pulsar.go b/api/cosmos/base/grpc/v2/service.pulsar.go new file mode 100644 index 000000000000..3112092f1add --- /dev/null +++ b/api/cosmos/base/grpc/v2/service.pulsar.go @@ -0,0 +1,2590 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package grpcv2 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryRequest protoreflect.MessageDescriptor + fd_QueryRequest_request protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_base_grpc_v2_service_proto_init() + md_QueryRequest = File_cosmos_base_grpc_v2_service_proto.Messages().ByName("QueryRequest") + fd_QueryRequest_request = md_QueryRequest.Fields().ByName("request") +} + +var _ protoreflect.Message = (*fastReflection_QueryRequest)(nil) + +type fastReflection_QueryRequest QueryRequest + +func (x *QueryRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryRequest)(x) +} + +func (x *QueryRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_base_grpc_v2_service_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_QueryRequest_messageType fastReflection_QueryRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryRequest_messageType{} + +type fastReflection_QueryRequest_messageType struct{} + +func (x fastReflection_QueryRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryRequest)(nil) +} +func (x fastReflection_QueryRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryRequest) +} +func (x fastReflection_QueryRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryRequest) New() protoreflect.Message { + return new(fastReflection_QueryRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryRequest) Interface() protoreflect.ProtoMessage { + return (*QueryRequest)(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_QueryRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Request != nil { + value := protoreflect.ValueOfMessage(x.Request.ProtoReflect()) + if !f(fd_QueryRequest_request, 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_QueryRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryRequest.request": + return x.Request != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryRequest 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_QueryRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryRequest.request": + x.Request = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryRequest 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_QueryRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.base.grpc.v2.QueryRequest.request": + value := x.Request + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryRequest 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_QueryRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryRequest.request": + x.Request = value.Message().Interface().(*anypb.Any) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryRequest 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_QueryRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryRequest.request": + if x.Request == nil { + x.Request = new(anypb.Any) + } + return protoreflect.ValueOfMessage(x.Request.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryRequest.request": + m := new(anypb.Any) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.grpc.v2.QueryRequest", 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_QueryRequest) 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_QueryRequest) 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_QueryRequest) 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_QueryRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryRequest) + 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.Request != nil { + l = options.Size(x.Request) + 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().(*QueryRequest) + 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.Request != nil { + encoded, err := options.Marshal(x.Request) + 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().(*QueryRequest) + 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: QueryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Request", 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.Request == nil { + x.Request = &anypb.Any{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Request); 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_QueryResponse protoreflect.MessageDescriptor + fd_QueryResponse_response protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_base_grpc_v2_service_proto_init() + md_QueryResponse = File_cosmos_base_grpc_v2_service_proto.Messages().ByName("QueryResponse") + fd_QueryResponse_response = md_QueryResponse.Fields().ByName("response") +} + +var _ protoreflect.Message = (*fastReflection_QueryResponse)(nil) + +type fastReflection_QueryResponse QueryResponse + +func (x *QueryResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryResponse)(x) +} + +func (x *QueryResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_base_grpc_v2_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryResponse_messageType fastReflection_QueryResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryResponse_messageType{} + +type fastReflection_QueryResponse_messageType struct{} + +func (x fastReflection_QueryResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryResponse)(nil) +} +func (x fastReflection_QueryResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryResponse) +} +func (x fastReflection_QueryResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryResponse) New() protoreflect.Message { + return new(fastReflection_QueryResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryResponse) Interface() protoreflect.ProtoMessage { + return (*QueryResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Response != nil { + value := protoreflect.ValueOfMessage(x.Response.ProtoReflect()) + if !f(fd_QueryResponse_response, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryResponse.response": + return x.Response != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryResponse.response": + x.Response = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.base.grpc.v2.QueryResponse.response": + value := x.Response + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryResponse.response": + x.Response = value.Message().Interface().(*anypb.Any) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryResponse.response": + if x.Response == nil { + x.Response = new(anypb.Any) + } + return protoreflect.ValueOfMessage(x.Response.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryResponse.response": + m := new(anypb.Any) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.grpc.v2.QueryResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Response != nil { + l = options.Size(x.Response) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Response != nil { + encoded, err := options.Marshal(x.Response) + 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().(*QueryResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Response", 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.Response == nil { + x.Response = &anypb.Any{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Response); 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_ListQueryHandlersRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_base_grpc_v2_service_proto_init() + md_ListQueryHandlersRequest = File_cosmos_base_grpc_v2_service_proto.Messages().ByName("ListQueryHandlersRequest") +} + +var _ protoreflect.Message = (*fastReflection_ListQueryHandlersRequest)(nil) + +type fastReflection_ListQueryHandlersRequest ListQueryHandlersRequest + +func (x *ListQueryHandlersRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_ListQueryHandlersRequest)(x) +} + +func (x *ListQueryHandlersRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_base_grpc_v2_service_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_ListQueryHandlersRequest_messageType fastReflection_ListQueryHandlersRequest_messageType +var _ protoreflect.MessageType = fastReflection_ListQueryHandlersRequest_messageType{} + +type fastReflection_ListQueryHandlersRequest_messageType struct{} + +func (x fastReflection_ListQueryHandlersRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_ListQueryHandlersRequest)(nil) +} +func (x fastReflection_ListQueryHandlersRequest_messageType) New() protoreflect.Message { + return new(fastReflection_ListQueryHandlersRequest) +} +func (x fastReflection_ListQueryHandlersRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ListQueryHandlersRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ListQueryHandlersRequest) Descriptor() protoreflect.MessageDescriptor { + return md_ListQueryHandlersRequest +} + +// 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_ListQueryHandlersRequest) Type() protoreflect.MessageType { + return _fastReflection_ListQueryHandlersRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ListQueryHandlersRequest) New() protoreflect.Message { + return new(fastReflection_ListQueryHandlersRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ListQueryHandlersRequest) Interface() protoreflect.ProtoMessage { + return (*ListQueryHandlersRequest)(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_ListQueryHandlersRequest) 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_ListQueryHandlersRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersRequest 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_ListQueryHandlersRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersRequest 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_ListQueryHandlersRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersRequest 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_ListQueryHandlersRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersRequest 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_ListQueryHandlersRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersRequest 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_ListQueryHandlersRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersRequest 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_ListQueryHandlersRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.grpc.v2.ListQueryHandlersRequest", 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_ListQueryHandlersRequest) 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_ListQueryHandlersRequest) 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_ListQueryHandlersRequest) 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_ListQueryHandlersRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ListQueryHandlersRequest) + 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().(*ListQueryHandlersRequest) + 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().(*ListQueryHandlersRequest) + 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: ListQueryHandlersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ListQueryHandlersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_ListQueryHandlersResponse_1_list)(nil) + +type _ListQueryHandlersResponse_1_list struct { + list *[]*Handler +} + +func (x *_ListQueryHandlersResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_ListQueryHandlersResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_ListQueryHandlersResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Handler) + (*x.list)[i] = concreteValue +} + +func (x *_ListQueryHandlersResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Handler) + *x.list = append(*x.list, concreteValue) +} + +func (x *_ListQueryHandlersResponse_1_list) AppendMutable() protoreflect.Value { + v := new(Handler) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ListQueryHandlersResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_ListQueryHandlersResponse_1_list) NewElement() protoreflect.Value { + v := new(Handler) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ListQueryHandlersResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_ListQueryHandlersResponse protoreflect.MessageDescriptor + fd_ListQueryHandlersResponse_handlers protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_base_grpc_v2_service_proto_init() + md_ListQueryHandlersResponse = File_cosmos_base_grpc_v2_service_proto.Messages().ByName("ListQueryHandlersResponse") + fd_ListQueryHandlersResponse_handlers = md_ListQueryHandlersResponse.Fields().ByName("handlers") +} + +var _ protoreflect.Message = (*fastReflection_ListQueryHandlersResponse)(nil) + +type fastReflection_ListQueryHandlersResponse ListQueryHandlersResponse + +func (x *ListQueryHandlersResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_ListQueryHandlersResponse)(x) +} + +func (x *ListQueryHandlersResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_base_grpc_v2_service_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_ListQueryHandlersResponse_messageType fastReflection_ListQueryHandlersResponse_messageType +var _ protoreflect.MessageType = fastReflection_ListQueryHandlersResponse_messageType{} + +type fastReflection_ListQueryHandlersResponse_messageType struct{} + +func (x fastReflection_ListQueryHandlersResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_ListQueryHandlersResponse)(nil) +} +func (x fastReflection_ListQueryHandlersResponse_messageType) New() protoreflect.Message { + return new(fastReflection_ListQueryHandlersResponse) +} +func (x fastReflection_ListQueryHandlersResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ListQueryHandlersResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ListQueryHandlersResponse) Descriptor() protoreflect.MessageDescriptor { + return md_ListQueryHandlersResponse +} + +// 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_ListQueryHandlersResponse) Type() protoreflect.MessageType { + return _fastReflection_ListQueryHandlersResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ListQueryHandlersResponse) New() protoreflect.Message { + return new(fastReflection_ListQueryHandlersResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ListQueryHandlersResponse) Interface() protoreflect.ProtoMessage { + return (*ListQueryHandlersResponse)(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_ListQueryHandlersResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Handlers) != 0 { + value := protoreflect.ValueOfList(&_ListQueryHandlersResponse_1_list{list: &x.Handlers}) + if !f(fd_ListQueryHandlersResponse_handlers, 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_ListQueryHandlersResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.base.grpc.v2.ListQueryHandlersResponse.handlers": + return len(x.Handlers) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersResponse 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_ListQueryHandlersResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.base.grpc.v2.ListQueryHandlersResponse.handlers": + x.Handlers = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersResponse 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_ListQueryHandlersResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.base.grpc.v2.ListQueryHandlersResponse.handlers": + if len(x.Handlers) == 0 { + return protoreflect.ValueOfList(&_ListQueryHandlersResponse_1_list{}) + } + listValue := &_ListQueryHandlersResponse_1_list{list: &x.Handlers} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersResponse 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_ListQueryHandlersResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.base.grpc.v2.ListQueryHandlersResponse.handlers": + lv := value.List() + clv := lv.(*_ListQueryHandlersResponse_1_list) + x.Handlers = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersResponse 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_ListQueryHandlersResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.grpc.v2.ListQueryHandlersResponse.handlers": + if x.Handlers == nil { + x.Handlers = []*Handler{} + } + value := &_ListQueryHandlersResponse_1_list{list: &x.Handlers} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersResponse 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_ListQueryHandlersResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.grpc.v2.ListQueryHandlersResponse.handlers": + list := []*Handler{} + return protoreflect.ValueOfList(&_ListQueryHandlersResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersResponse 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_ListQueryHandlersResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.grpc.v2.ListQueryHandlersResponse", 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_ListQueryHandlersResponse) 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_ListQueryHandlersResponse) 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_ListQueryHandlersResponse) 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_ListQueryHandlersResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ListQueryHandlersResponse) + 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.Handlers) > 0 { + for _, e := range x.Handlers { + 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().(*ListQueryHandlersResponse) + 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.Handlers) > 0 { + for iNdEx := len(x.Handlers) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Handlers[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().(*ListQueryHandlersResponse) + 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: ListQueryHandlersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ListQueryHandlersResponse: 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 Handlers", 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.Handlers = append(x.Handlers, &Handler{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Handlers[len(x.Handlers)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_Handler protoreflect.MessageDescriptor + fd_Handler_request_name protoreflect.FieldDescriptor + fd_Handler_response_name protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_base_grpc_v2_service_proto_init() + md_Handler = File_cosmos_base_grpc_v2_service_proto.Messages().ByName("Handler") + fd_Handler_request_name = md_Handler.Fields().ByName("request_name") + fd_Handler_response_name = md_Handler.Fields().ByName("response_name") +} + +var _ protoreflect.Message = (*fastReflection_Handler)(nil) + +type fastReflection_Handler Handler + +func (x *Handler) ProtoReflect() protoreflect.Message { + return (*fastReflection_Handler)(x) +} + +func (x *Handler) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_base_grpc_v2_service_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_Handler_messageType fastReflection_Handler_messageType +var _ protoreflect.MessageType = fastReflection_Handler_messageType{} + +type fastReflection_Handler_messageType struct{} + +func (x fastReflection_Handler_messageType) Zero() protoreflect.Message { + return (*fastReflection_Handler)(nil) +} +func (x fastReflection_Handler_messageType) New() protoreflect.Message { + return new(fastReflection_Handler) +} +func (x fastReflection_Handler_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Handler +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Handler) Descriptor() protoreflect.MessageDescriptor { + return md_Handler +} + +// 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_Handler) Type() protoreflect.MessageType { + return _fastReflection_Handler_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Handler) New() protoreflect.Message { + return new(fastReflection_Handler) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Handler) Interface() protoreflect.ProtoMessage { + return (*Handler)(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_Handler) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.RequestName != "" { + value := protoreflect.ValueOfString(x.RequestName) + if !f(fd_Handler_request_name, value) { + return + } + } + if x.ResponseName != "" { + value := protoreflect.ValueOfString(x.ResponseName) + if !f(fd_Handler_response_name, 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_Handler) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.base.grpc.v2.Handler.request_name": + return x.RequestName != "" + case "cosmos.base.grpc.v2.Handler.response_name": + return x.ResponseName != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.Handler")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.Handler 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_Handler) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.base.grpc.v2.Handler.request_name": + x.RequestName = "" + case "cosmos.base.grpc.v2.Handler.response_name": + x.ResponseName = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.Handler")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.Handler 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_Handler) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.base.grpc.v2.Handler.request_name": + value := x.RequestName + return protoreflect.ValueOfString(value) + case "cosmos.base.grpc.v2.Handler.response_name": + value := x.ResponseName + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.Handler")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.Handler 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_Handler) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.base.grpc.v2.Handler.request_name": + x.RequestName = value.Interface().(string) + case "cosmos.base.grpc.v2.Handler.response_name": + x.ResponseName = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.Handler")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.Handler 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_Handler) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.grpc.v2.Handler.request_name": + panic(fmt.Errorf("field request_name of message cosmos.base.grpc.v2.Handler is not mutable")) + case "cosmos.base.grpc.v2.Handler.response_name": + panic(fmt.Errorf("field response_name of message cosmos.base.grpc.v2.Handler is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.Handler")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.Handler 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_Handler) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.grpc.v2.Handler.request_name": + return protoreflect.ValueOfString("") + case "cosmos.base.grpc.v2.Handler.response_name": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.Handler")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.Handler 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_Handler) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.grpc.v2.Handler", 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_Handler) 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_Handler) 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_Handler) 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_Handler) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Handler) + 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.RequestName) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ResponseName) + 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().(*Handler) + 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.ResponseName) > 0 { + i -= len(x.ResponseName) + copy(dAtA[i:], x.ResponseName) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ResponseName))) + i-- + dAtA[i] = 0x12 + } + if len(x.RequestName) > 0 { + i -= len(x.RequestName) + copy(dAtA[i:], x.RequestName) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RequestName))) + 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().(*Handler) + 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: Handler: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Handler: 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 RequestName", 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.RequestName = 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 ResponseName", 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.ResponseName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/base/grpc/v2/service.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) +) + +// QueryRequest is the request for the Query method +type QueryRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Request *anypb.Any `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` +} + +func (x *QueryRequest) Reset() { + *x = QueryRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_base_grpc_v2_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRequest) ProtoMessage() {} + +// Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead. +func (*QueryRequest) Descriptor() ([]byte, []int) { + return file_cosmos_base_grpc_v2_service_proto_rawDescGZIP(), []int{0} +} + +func (x *QueryRequest) GetRequest() *anypb.Any { + if x != nil { + return x.Request + } + return nil +} + +// QueryResponse is the response for the Query method +type QueryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Response *anypb.Any `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` +} + +func (x *QueryResponse) Reset() { + *x = QueryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_base_grpc_v2_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryResponse) ProtoMessage() {} + +// Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead. +func (*QueryResponse) Descriptor() ([]byte, []int) { + return file_cosmos_base_grpc_v2_service_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryResponse) GetResponse() *anypb.Any { + if x != nil { + return x.Response + } + return nil +} + +// ListQueryHandlersRequest is the request for the ListQueryHandlers method +type ListQueryHandlersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListQueryHandlersRequest) Reset() { + *x = ListQueryHandlersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_base_grpc_v2_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListQueryHandlersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListQueryHandlersRequest) ProtoMessage() {} + +// Deprecated: Use ListQueryHandlersRequest.ProtoReflect.Descriptor instead. +func (*ListQueryHandlersRequest) Descriptor() ([]byte, []int) { + return file_cosmos_base_grpc_v2_service_proto_rawDescGZIP(), []int{2} +} + +// ListQueryHandlersResponse is the response for the ListQueryHandlers method +type ListQueryHandlersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Handlers []*Handler `protobuf:"bytes,1,rep,name=handlers,proto3" json:"handlers,omitempty"` +} + +func (x *ListQueryHandlersResponse) Reset() { + *x = ListQueryHandlersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_base_grpc_v2_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListQueryHandlersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListQueryHandlersResponse) ProtoMessage() {} + +// Deprecated: Use ListQueryHandlersResponse.ProtoReflect.Descriptor instead. +func (*ListQueryHandlersResponse) Descriptor() ([]byte, []int) { + return file_cosmos_base_grpc_v2_service_proto_rawDescGZIP(), []int{3} +} + +func (x *ListQueryHandlersResponse) GetHandlers() []*Handler { + if x != nil { + return x.Handlers + } + return nil +} + +// Handler defines a query handler +type Handler struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RequestName string `protobuf:"bytes,1,opt,name=request_name,json=requestName,proto3" json:"request_name,omitempty"` + ResponseName string `protobuf:"bytes,2,opt,name=response_name,json=responseName,proto3" json:"response_name,omitempty"` +} + +func (x *Handler) Reset() { + *x = Handler{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_base_grpc_v2_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Handler) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Handler) ProtoMessage() {} + +// Deprecated: Use Handler.ProtoReflect.Descriptor instead. +func (*Handler) Descriptor() ([]byte, []int) { + return file_cosmos_base_grpc_v2_service_proto_rawDescGZIP(), []int{4} +} + +func (x *Handler) GetRequestName() string { + if x != nil { + return x.RequestName + } + return "" +} + +func (x *Handler) GetResponseName() string { + if x != nil { + return x.ResponseName + } + return "" +} + +var File_cosmos_base_grpc_v2_service_proto protoreflect.FileDescriptor + +var file_cosmos_base_grpc_v2_service_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x32, 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, 0x3e, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0x41, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x22, 0x55, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, + 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x38, 0x0a, 0x08, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x32, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, + 0x08, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x22, 0x51, 0x0a, 0x07, 0x48, 0x61, 0x6e, + 0x64, 0x6c, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x32, 0xd1, 0x01, 0x0a, + 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x50, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x74, 0x0a, 0x11, 0x4c, 0x69, + 0x73, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x12, + 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, + 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x61, + 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x42, 0xc3, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x32, 0x42, 0x0c, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2b, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, + 0x76, 0x32, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x47, 0xaa, + 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x2e, 0x47, 0x72, + 0x70, 0x63, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, + 0x61, 0x73, 0x65, 0x5c, 0x47, 0x72, 0x70, 0x63, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x1f, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x47, 0x72, 0x70, 0x63, 0x5c, 0x56, + 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x3a, 0x47, 0x72, + 0x70, 0x63, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_base_grpc_v2_service_proto_rawDescOnce sync.Once + file_cosmos_base_grpc_v2_service_proto_rawDescData = file_cosmos_base_grpc_v2_service_proto_rawDesc +) + +func file_cosmos_base_grpc_v2_service_proto_rawDescGZIP() []byte { + file_cosmos_base_grpc_v2_service_proto_rawDescOnce.Do(func() { + file_cosmos_base_grpc_v2_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_base_grpc_v2_service_proto_rawDescData) + }) + return file_cosmos_base_grpc_v2_service_proto_rawDescData +} + +var file_cosmos_base_grpc_v2_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_cosmos_base_grpc_v2_service_proto_goTypes = []interface{}{ + (*QueryRequest)(nil), // 0: cosmos.base.grpc.v2.QueryRequest + (*QueryResponse)(nil), // 1: cosmos.base.grpc.v2.QueryResponse + (*ListQueryHandlersRequest)(nil), // 2: cosmos.base.grpc.v2.ListQueryHandlersRequest + (*ListQueryHandlersResponse)(nil), // 3: cosmos.base.grpc.v2.ListQueryHandlersResponse + (*Handler)(nil), // 4: cosmos.base.grpc.v2.Handler + (*anypb.Any)(nil), // 5: google.protobuf.Any +} +var file_cosmos_base_grpc_v2_service_proto_depIdxs = []int32{ + 5, // 0: cosmos.base.grpc.v2.QueryRequest.request:type_name -> google.protobuf.Any + 5, // 1: cosmos.base.grpc.v2.QueryResponse.response:type_name -> google.protobuf.Any + 4, // 2: cosmos.base.grpc.v2.ListQueryHandlersResponse.handlers:type_name -> cosmos.base.grpc.v2.Handler + 0, // 3: cosmos.base.grpc.v2.Service.Query:input_type -> cosmos.base.grpc.v2.QueryRequest + 2, // 4: cosmos.base.grpc.v2.Service.ListQueryHandlers:input_type -> cosmos.base.grpc.v2.ListQueryHandlersRequest + 1, // 5: cosmos.base.grpc.v2.Service.Query:output_type -> cosmos.base.grpc.v2.QueryResponse + 3, // 6: cosmos.base.grpc.v2.Service.ListQueryHandlers:output_type -> cosmos.base.grpc.v2.ListQueryHandlersResponse + 5, // [5:7] is the sub-list for method output_type + 3, // [3:5] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_cosmos_base_grpc_v2_service_proto_init() } +func file_cosmos_base_grpc_v2_service_proto_init() { + if File_cosmos_base_grpc_v2_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_base_grpc_v2_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_base_grpc_v2_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_base_grpc_v2_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListQueryHandlersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_base_grpc_v2_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListQueryHandlersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_base_grpc_v2_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Handler); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_base_grpc_v2_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_base_grpc_v2_service_proto_goTypes, + DependencyIndexes: file_cosmos_base_grpc_v2_service_proto_depIdxs, + MessageInfos: file_cosmos_base_grpc_v2_service_proto_msgTypes, + }.Build() + File_cosmos_base_grpc_v2_service_proto = out.File + file_cosmos_base_grpc_v2_service_proto_rawDesc = nil + file_cosmos_base_grpc_v2_service_proto_goTypes = nil + file_cosmos_base_grpc_v2_service_proto_depIdxs = nil +} diff --git a/api/cosmos/base/grpc/v2/service_grpc.pb.go b/api/cosmos/base/grpc/v2/service_grpc.pb.go new file mode 100644 index 000000000000..689431d223aa --- /dev/null +++ b/api/cosmos/base/grpc/v2/service_grpc.pb.go @@ -0,0 +1,167 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: cosmos/base/grpc/v2/service.proto + +package grpcv2 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Service_Query_FullMethodName = "/cosmos.base.grpc.v2.Service/Query" + Service_ListQueryHandlers_FullMethodName = "/cosmos.base.grpc.v2.Service/ListQueryHandlers" +) + +// ServiceClient is the client API for Service service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Service defines the gRPC service for query server for v2 +type ServiceClient interface { + // Query queries the server with a request, the request can be any sdk Msg. + Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // ListQueryHandlers lists all the available query handlers. + ListQueryHandlers(ctx context.Context, in *ListQueryHandlersRequest, opts ...grpc.CallOption) (*ListQueryHandlersResponse, error) +} + +type serviceClient struct { + cc grpc.ClientConnInterface +} + +func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient { + return &serviceClient{cc} +} + +func (c *serviceClient) Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryResponse) + err := c.cc.Invoke(ctx, Service_Query_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) ListQueryHandlers(ctx context.Context, in *ListQueryHandlersRequest, opts ...grpc.CallOption) (*ListQueryHandlersResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListQueryHandlersResponse) + err := c.cc.Invoke(ctx, Service_ListQueryHandlers_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ServiceServer is the server API for Service service. +// All implementations must embed UnimplementedServiceServer +// for forward compatibility. +// +// Service defines the gRPC service for query server for v2 +type ServiceServer interface { + // Query queries the server with a request, the request can be any sdk Msg. + Query(context.Context, *QueryRequest) (*QueryResponse, error) + // ListQueryHandlers lists all the available query handlers. + ListQueryHandlers(context.Context, *ListQueryHandlersRequest) (*ListQueryHandlersResponse, error) + mustEmbedUnimplementedServiceServer() +} + +// UnimplementedServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedServiceServer struct{} + +func (UnimplementedServiceServer) Query(context.Context, *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Query not implemented") +} +func (UnimplementedServiceServer) ListQueryHandlers(context.Context, *ListQueryHandlersRequest) (*ListQueryHandlersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListQueryHandlers not implemented") +} +func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {} +func (UnimplementedServiceServer) testEmbeddedByValue() {} + +// UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ServiceServer will +// result in compilation errors. +type UnsafeServiceServer interface { + mustEmbedUnimplementedServiceServer() +} + +func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer) { + // If the following call pancis, it indicates UnimplementedServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Service_ServiceDesc, srv) +} + +func _Service_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).Query(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Service_Query_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).Query(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_ListQueryHandlers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListQueryHandlersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).ListQueryHandlers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Service_ListQueryHandlers_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).ListQueryHandlers(ctx, req.(*ListQueryHandlersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Service_ServiceDesc is the grpc.ServiceDesc for Service service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Service_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.base.grpc.v2.Service", + HandlerType: (*ServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Query", + Handler: _Service_Query_Handler, + }, + { + MethodName: "ListQueryHandlers", + Handler: _Service_ListQueryHandlers_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/base/grpc/v2/service.proto", +} diff --git a/proto/cosmos/base/grpc/v2/service.proto b/proto/cosmos/base/grpc/v2/service.proto new file mode 100644 index 000000000000..4ac86c552cc5 --- /dev/null +++ b/proto/cosmos/base/grpc/v2/service.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; +package cosmos.base.grpc.v2; + +import "google/protobuf/any.proto"; + +option go_package = "cosmossdk.io/server/v2/api/grpc"; + +// Service defines the gRPC service for query server for v2 +service Service { + // Query queries the server with a request, the request can be any sdk Msg. + rpc Query(QueryRequest) returns (QueryResponse) {} + + // ListQueryHandlers lists all the available query handlers. + rpc ListQueryHandlers(ListQueryHandlersRequest) returns (ListQueryHandlersResponse) {} +} + +// QueryRequest is the request for the Query method +message QueryRequest { + google.protobuf.Any request = 1; +} + +// QueryResponse is the response for the Query method +message QueryResponse { + google.protobuf.Any response = 1; +} + +// ListQueryHandlersRequest is the request for the ListQueryHandlers method +message ListQueryHandlersRequest {} + +// ListQueryHandlersResponse is the response for the ListQueryHandlers method +message ListQueryHandlersResponse { + repeated Handler handlers = 1; +} + +// Handler defines a query handler +message Handler { + string request_name = 1; + string response_name = 2; +} \ No newline at end of file diff --git a/server/v2/api/grpc/server.go b/server/v2/api/grpc/server.go index e163bf3183c1..12cc1e6add1a 100644 --- a/server/v2/api/grpc/server.go +++ b/server/v2/api/grpc/server.go @@ -74,6 +74,9 @@ func New[T transaction.Tx]( // Reflection allows external clients to see what services and methods the gRPC server exposes. gogoreflection.Register(grpcSrv, slices.Collect(maps.Keys(queryHandlers)), logger.With("sub-module", "grpc-reflection")) + // Register V2 + RegisterServiceServer(grpcSrv, &v2Service{queryHandlers, queryable}) + srv.grpcSrv = grpcSrv srv.config = serverCfg srv.logger = logger.With(log.ModuleKey, srv.Name()) diff --git a/server/v2/api/grpc/service.go b/server/v2/api/grpc/service.go new file mode 100644 index 000000000000..e373fa910469 --- /dev/null +++ b/server/v2/api/grpc/service.go @@ -0,0 +1,73 @@ +package grpc + +import ( + "context" + + "github.com/cosmos/gogoproto/proto" + gogoproto "github.com/cosmos/gogoproto/types/any" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + appmodulev2 "cosmossdk.io/core/appmodule/v2" + "cosmossdk.io/core/transaction" +) + +// v2Service implements the gRPC service interface for handling queries and listing handlers. +type v2Service struct { + queryHandlers map[string]appmodulev2.Handler + queryable interface { + Query(ctx context.Context, version uint64, msg transaction.Msg) (transaction.Msg, error) + } +} + +// Query handles incoming query requests by unmarshaling the request, processing it, +// and returning the response in an Any protobuf message. +func (s v2Service) Query(ctx context.Context, request *QueryRequest) (*QueryResponse, error) { + if request == nil || request.Request == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + msgName := request.Request.TypeUrl + + handler, exists := s.queryHandlers[msgName] + if !exists { + return nil, status.Errorf(codes.NotFound, "handler not found for %s", msgName) + } + + protoMsg := handler.MakeMsg() + if err := proto.Unmarshal(request.Request.Value, protoMsg); err != nil { + return nil, status.Errorf(codes.InvalidArgument, "failed to unmarshal request: %v", err) + } + + queryResp, err := s.queryable.Query(ctx, 0, protoMsg) + if err != nil { + return nil, status.Errorf(codes.Internal, "query failed: %v", err) + } + + respBytes, err := proto.Marshal(queryResp) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to marshal response: %v", err) + } + + anyResp := &gogoproto.Any{ + TypeUrl: "/" + proto.MessageName(queryResp), + Value: respBytes, + } + + return &QueryResponse{Response: anyResp}, nil +} + +func (s v2Service) ListQueryHandlers(_ context.Context, _ *ListQueryHandlersRequest) (*ListQueryHandlersResponse, error) { + var handlerDescriptors []*Handler + for handlerName := range s.queryHandlers { + msg := s.queryHandlers[handlerName].MakeMsg() + resp := s.queryHandlers[handlerName].MakeMsgResp() + + handlerDescriptors = append(handlerDescriptors, &Handler{ + RequestName: proto.MessageName(msg), + ResponseName: proto.MessageName(resp), + }) + } + + return &ListQueryHandlersResponse{Handlers: handlerDescriptors}, nil +} diff --git a/server/v2/api/grpc/service.pb.go b/server/v2/api/grpc/service.pb.go new file mode 100644 index 000000000000..64ecb79c0332 --- /dev/null +++ b/server/v2/api/grpc/service.pb.go @@ -0,0 +1,1167 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/base/grpc/v2/service.proto + +package grpc + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// QueryRequest is the request for the Query method +type QueryRequest struct { + Request *any.Any `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` +} + +func (m *QueryRequest) Reset() { *m = QueryRequest{} } +func (m *QueryRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRequest) ProtoMessage() {} +func (*QueryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d2a65dd0225af870, []int{0} +} +func (m *QueryRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRequest.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 *QueryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRequest.Merge(m, src) +} +func (m *QueryRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRequest proto.InternalMessageInfo + +func (m *QueryRequest) GetRequest() *any.Any { + if m != nil { + return m.Request + } + return nil +} + +// QueryResponse is the response for the Query method +type QueryResponse struct { + Response *any.Any `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` +} + +func (m *QueryResponse) Reset() { *m = QueryResponse{} } +func (m *QueryResponse) String() string { return proto.CompactTextString(m) } +func (*QueryResponse) ProtoMessage() {} +func (*QueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d2a65dd0225af870, []int{1} +} +func (m *QueryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResponse.Merge(m, src) +} +func (m *QueryResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryResponse proto.InternalMessageInfo + +func (m *QueryResponse) GetResponse() *any.Any { + if m != nil { + return m.Response + } + return nil +} + +// ListQueryHandlersRequest is the request for the ListQueryHandlers method +type ListQueryHandlersRequest struct { +} + +func (m *ListQueryHandlersRequest) Reset() { *m = ListQueryHandlersRequest{} } +func (m *ListQueryHandlersRequest) String() string { return proto.CompactTextString(m) } +func (*ListQueryHandlersRequest) ProtoMessage() {} +func (*ListQueryHandlersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d2a65dd0225af870, []int{2} +} +func (m *ListQueryHandlersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListQueryHandlersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListQueryHandlersRequest.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 *ListQueryHandlersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListQueryHandlersRequest.Merge(m, src) +} +func (m *ListQueryHandlersRequest) XXX_Size() int { + return m.Size() +} +func (m *ListQueryHandlersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListQueryHandlersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListQueryHandlersRequest proto.InternalMessageInfo + +// ListQueryHandlersResponse is the response for the ListQueryHandlers method +type ListQueryHandlersResponse struct { + Handlers []*Handler `protobuf:"bytes,1,rep,name=handlers,proto3" json:"handlers,omitempty"` +} + +func (m *ListQueryHandlersResponse) Reset() { *m = ListQueryHandlersResponse{} } +func (m *ListQueryHandlersResponse) String() string { return proto.CompactTextString(m) } +func (*ListQueryHandlersResponse) ProtoMessage() {} +func (*ListQueryHandlersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d2a65dd0225af870, []int{3} +} +func (m *ListQueryHandlersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListQueryHandlersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListQueryHandlersResponse.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 *ListQueryHandlersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListQueryHandlersResponse.Merge(m, src) +} +func (m *ListQueryHandlersResponse) XXX_Size() int { + return m.Size() +} +func (m *ListQueryHandlersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListQueryHandlersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListQueryHandlersResponse proto.InternalMessageInfo + +func (m *ListQueryHandlersResponse) GetHandlers() []*Handler { + if m != nil { + return m.Handlers + } + return nil +} + +// Handler defines a query handler +type Handler struct { + RequestName string `protobuf:"bytes,1,opt,name=request_name,json=requestName,proto3" json:"request_name,omitempty"` + ResponseName string `protobuf:"bytes,2,opt,name=response_name,json=responseName,proto3" json:"response_name,omitempty"` +} + +func (m *Handler) Reset() { *m = Handler{} } +func (m *Handler) String() string { return proto.CompactTextString(m) } +func (*Handler) ProtoMessage() {} +func (*Handler) Descriptor() ([]byte, []int) { + return fileDescriptor_d2a65dd0225af870, []int{4} +} +func (m *Handler) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Handler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Handler.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 *Handler) XXX_Merge(src proto.Message) { + xxx_messageInfo_Handler.Merge(m, src) +} +func (m *Handler) XXX_Size() int { + return m.Size() +} +func (m *Handler) XXX_DiscardUnknown() { + xxx_messageInfo_Handler.DiscardUnknown(m) +} + +var xxx_messageInfo_Handler proto.InternalMessageInfo + +func (m *Handler) GetRequestName() string { + if m != nil { + return m.RequestName + } + return "" +} + +func (m *Handler) GetResponseName() string { + if m != nil { + return m.ResponseName + } + return "" +} + +func init() { + proto.RegisterType((*QueryRequest)(nil), "cosmos.base.grpc.v2.QueryRequest") + proto.RegisterType((*QueryResponse)(nil), "cosmos.base.grpc.v2.QueryResponse") + proto.RegisterType((*ListQueryHandlersRequest)(nil), "cosmos.base.grpc.v2.ListQueryHandlersRequest") + proto.RegisterType((*ListQueryHandlersResponse)(nil), "cosmos.base.grpc.v2.ListQueryHandlersResponse") + proto.RegisterType((*Handler)(nil), "cosmos.base.grpc.v2.Handler") +} + +func init() { proto.RegisterFile("cosmos/base/grpc/v2/service.proto", fileDescriptor_d2a65dd0225af870) } + +var fileDescriptor_d2a65dd0225af870 = []byte{ + // 352 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x31, 0x4f, 0xc2, 0x40, + 0x14, 0xc7, 0x7b, 0x1a, 0x05, 0x1f, 0x30, 0x78, 0x3a, 0x40, 0x63, 0x2a, 0xd4, 0x85, 0xc5, 0x57, + 0x53, 0x17, 0x5d, 0x4c, 0x70, 0x72, 0x30, 0x46, 0x6a, 0x5c, 0x5c, 0x4c, 0x81, 0x13, 0x1b, 0xa1, + 0x57, 0xef, 0x0a, 0x09, 0xdf, 0xc2, 0x8f, 0xe5, 0x88, 0x9b, 0xa3, 0x81, 0x2f, 0x62, 0x7a, 0x77, + 0x25, 0x26, 0x56, 0xe2, 0x76, 0x79, 0xf7, 0xfb, 0xbf, 0xfb, 0xdf, 0xff, 0x3d, 0x68, 0xf5, 0xb9, + 0x1c, 0x73, 0xe9, 0xf5, 0x42, 0xc9, 0xbc, 0xa1, 0x48, 0xfa, 0xde, 0xd4, 0xf7, 0x24, 0x13, 0xd3, + 0xa8, 0xcf, 0x30, 0x11, 0x3c, 0xe5, 0x74, 0x4f, 0x23, 0x98, 0x21, 0x98, 0x21, 0x38, 0xf5, 0xed, + 0xc6, 0x90, 0xf3, 0xe1, 0x88, 0x79, 0x0a, 0xe9, 0x4d, 0x9e, 0xbc, 0x30, 0x9e, 0x69, 0xde, 0xbd, + 0x80, 0x6a, 0x77, 0xc2, 0xc4, 0x2c, 0x60, 0xaf, 0x13, 0x26, 0x53, 0x8a, 0x50, 0x12, 0xfa, 0x58, + 0x27, 0x4d, 0xd2, 0xae, 0xf8, 0xfb, 0xa8, 0xc5, 0x98, 0x8b, 0xb1, 0x13, 0xcf, 0x82, 0x1c, 0x72, + 0x3b, 0x50, 0x33, 0x7a, 0x99, 0xf0, 0x58, 0x32, 0x7a, 0x02, 0x65, 0x61, 0xce, 0x6b, 0x3b, 0xac, + 0x28, 0xd7, 0x86, 0xfa, 0x75, 0x24, 0x53, 0xd5, 0xe6, 0x2a, 0x8c, 0x07, 0x23, 0x26, 0xa4, 0xb1, + 0xe3, 0xde, 0x43, 0xa3, 0xe0, 0xce, 0x3c, 0x75, 0x06, 0xe5, 0x67, 0x53, 0xab, 0x93, 0xe6, 0x66, + 0xbb, 0xe2, 0x1f, 0x60, 0xc1, 0xf7, 0xd1, 0x08, 0x83, 0x15, 0xed, 0x76, 0xa1, 0x64, 0x8a, 0xb4, + 0x05, 0x55, 0xf3, 0x97, 0xc7, 0x38, 0x1c, 0x6b, 0xcf, 0x3b, 0x41, 0xc5, 0xd4, 0x6e, 0xc2, 0x31, + 0xa3, 0x47, 0x50, 0xcb, 0xcd, 0x6a, 0x66, 0x43, 0x31, 0xd5, 0xbc, 0x98, 0x41, 0xfe, 0x07, 0x81, + 0xd2, 0x9d, 0x1e, 0x05, 0xbd, 0x85, 0x2d, 0xe5, 0x98, 0xb6, 0x0a, 0xfd, 0xfc, 0x0c, 0xdc, 0x76, + 0xd7, 0x21, 0x26, 0x21, 0x8b, 0xa6, 0xb0, 0xfb, 0x2b, 0x07, 0x7a, 0x5c, 0x28, 0xfd, 0x2b, 0x4b, + 0x1b, 0xff, 0x8b, 0xe7, 0xaf, 0x5e, 0x9e, 0xbf, 0x2f, 0x1c, 0x32, 0x5f, 0x38, 0xe4, 0x6b, 0xe1, + 0x90, 0xb7, 0xa5, 0x63, 0xcd, 0x97, 0x8e, 0xf5, 0xb9, 0x74, 0xac, 0x87, 0x43, 0xdd, 0x4a, 0x0e, + 0x5e, 0x30, 0xe2, 0x6a, 0x05, 0x99, 0xc8, 0x96, 0x31, 0x4c, 0x22, 0xb5, 0x98, 0xbd, 0x6d, 0x35, + 0xec, 0xd3, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x00, 0xa2, 0x0d, 0xb3, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// ServiceClient is the client API for Service service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ServiceClient interface { + // Query queries the server with a request, the request can be any sdk Msg. + Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // ListQueryHandlers lists all the available query handlers. + ListQueryHandlers(ctx context.Context, in *ListQueryHandlersRequest, opts ...grpc.CallOption) (*ListQueryHandlersResponse, error) +} + +type serviceClient struct { + cc grpc1.ClientConn +} + +func NewServiceClient(cc grpc1.ClientConn) ServiceClient { + return &serviceClient{cc} +} + +func (c *serviceClient) Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.grpc.v2.Service/Query", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) ListQueryHandlers(ctx context.Context, in *ListQueryHandlersRequest, opts ...grpc.CallOption) (*ListQueryHandlersResponse, error) { + out := new(ListQueryHandlersResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.grpc.v2.Service/ListQueryHandlers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ServiceServer is the server API for Service service. +type ServiceServer interface { + // Query queries the server with a request, the request can be any sdk Msg. + Query(context.Context, *QueryRequest) (*QueryResponse, error) + // ListQueryHandlers lists all the available query handlers. + ListQueryHandlers(context.Context, *ListQueryHandlersRequest) (*ListQueryHandlersResponse, error) +} + +// UnimplementedServiceServer can be embedded to have forward compatible implementations. +type UnimplementedServiceServer struct { +} + +func (*UnimplementedServiceServer) Query(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Query not implemented") +} +func (*UnimplementedServiceServer) ListQueryHandlers(ctx context.Context, req *ListQueryHandlersRequest) (*ListQueryHandlersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListQueryHandlers not implemented") +} + +func RegisterServiceServer(s grpc1.Server, srv ServiceServer) { + s.RegisterService(&_Service_serviceDesc, srv) +} + +func _Service_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).Query(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.grpc.v2.Service/Query", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).Query(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_ListQueryHandlers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListQueryHandlersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).ListQueryHandlers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.grpc.v2.Service/ListQueryHandlers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).ListQueryHandlers(ctx, req.(*ListQueryHandlersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var Service_serviceDesc = _Service_serviceDesc +var _Service_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.base.grpc.v2.Service", + HandlerType: (*ServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Query", + Handler: _Service_Query_Handler, + }, + { + MethodName: "ListQueryHandlers", + Handler: _Service_ListQueryHandlers_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/base/grpc/v2/service.proto", +} + +func (m *QueryRequest) 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 *QueryRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Request != nil { + { + size, err := m.Request.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Response != nil { + { + size, err := m.Response.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ListQueryHandlersRequest) 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 *ListQueryHandlersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListQueryHandlersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ListQueryHandlersResponse) 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 *ListQueryHandlersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListQueryHandlersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Handlers) > 0 { + for iNdEx := len(m.Handlers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Handlers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Handler) 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 *Handler) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Handler) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ResponseName) > 0 { + i -= len(m.ResponseName) + copy(dAtA[i:], m.ResponseName) + i = encodeVarintService(dAtA, i, uint64(len(m.ResponseName))) + i-- + dAtA[i] = 0x12 + } + if len(m.RequestName) > 0 { + i -= len(m.RequestName) + copy(dAtA[i:], m.RequestName) + i = encodeVarintService(dAtA, i, uint64(len(m.RequestName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintService(dAtA []byte, offset int, v uint64) int { + offset -= sovService(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Request != nil { + l = m.Request.Size() + n += 1 + l + sovService(uint64(l)) + } + return n +} + +func (m *QueryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Response != nil { + l = m.Response.Size() + n += 1 + l + sovService(uint64(l)) + } + return n +} + +func (m *ListQueryHandlersRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ListQueryHandlersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Handlers) > 0 { + for _, e := range m.Handlers { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } + } + return n +} + +func (m *Handler) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RequestName) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + l = len(m.ResponseName) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + return n +} + +func sovService(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozService(x uint64) (n int) { + return sovService(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryRequest) 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 ErrIntOverflowService + } + 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: QueryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Request == nil { + m.Request = &any.Any{} + } + if err := m.Request.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Response == nil { + m.Response = &any.Any{} + } + if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListQueryHandlersRequest) 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 ErrIntOverflowService + } + 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: ListQueryHandlersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListQueryHandlersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListQueryHandlersResponse) 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 ErrIntOverflowService + } + 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: ListQueryHandlersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListQueryHandlersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Handlers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Handlers = append(m.Handlers, &Handler{}) + if err := m.Handlers[len(m.Handlers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Handler) 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 ErrIntOverflowService + } + 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: Handler: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Handler: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RequestName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResponseName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResponseName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipService(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, ErrIntOverflowService + } + 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, ErrIntOverflowService + } + 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, ErrIntOverflowService + } + 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, ErrInvalidLengthService + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupService + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthService + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthService = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowService = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupService = fmt.Errorf("proto: unexpected end of group") +) diff --git a/server/v2/api/grpc/service_test.go b/server/v2/api/grpc/service_test.go new file mode 100644 index 000000000000..5c416f60c166 --- /dev/null +++ b/server/v2/api/grpc/service_test.go @@ -0,0 +1,227 @@ +package grpc + +import ( + "context" + "fmt" + "testing" + + "github.com/cosmos/gogoproto/proto" + gogoproto "github.com/cosmos/gogoproto/types/any" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + appmodulev2 "cosmossdk.io/core/appmodule/v2" + "cosmossdk.io/core/transaction" + serverv2 "cosmossdk.io/server/v2" +) + +type MockRequestMessage struct { + Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *MockRequestMessage) XXX_MessageName() string { + return "MockRequestMessage" +} +func (m *MockRequestMessage) Reset() {} +func (m *MockRequestMessage) String() string { return "" } +func (m *MockRequestMessage) ProtoMessage() {} +func (m *MockRequestMessage) ValidateBasic() error { + return nil +} + +type MockResponseMessage struct { + Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *MockResponseMessage) Reset() {} +func (m *MockResponseMessage) String() string { return "" } +func (m *MockResponseMessage) ProtoMessage() {} +func (m *MockResponseMessage) ValidateBasic() error { + return nil +} + +type mockApp[T transaction.Tx] struct { + mock.Mock + + serverv2.AppI[T] +} + +func (m *mockApp[T]) QueryHandlers() map[string]appmodulev2.Handler { + args := m.Called() + return args.Get(0).(map[string]appmodulev2.Handler) +} + +func (m *mockApp[T]) Query(ctx context.Context, height uint64, msg transaction.Msg) (transaction.Msg, error) { + args := m.Called(ctx, height, msg) + if args.Get(0) == nil { + return nil, args.Error(1) + } + return args.Get(0).(transaction.Msg), args.Error(1) +} + +func TestQuery(t *testing.T) { + tests := []struct { + name string + setupMock func(app *mockApp[transaction.Tx]) + request *QueryRequest + expectError bool + expectedError string + }{ + { + name: "successful query", + setupMock: func(app *mockApp[transaction.Tx]) { + reqMsg := &MockRequestMessage{Data: "request"} + respMsg := &MockResponseMessage{Data: "response"} + + handlers := map[string]appmodulev2.Handler{ + "/" + proto.MessageName(&MockRequestMessage{}): { + Func: func(ctx context.Context, msg transaction.Msg) (transaction.Msg, error) { + return respMsg, nil + }, + MakeMsg: func() transaction.Msg { + return reqMsg + }, + MakeMsgResp: func() transaction.Msg { + return respMsg + }, + }, + } + app.On("QueryHandlers").Return(handlers) + app.On("Query", mock.Anything, uint64(0), reqMsg).Return(respMsg, nil) + }, + + request: createTestRequest(t), + expectError: false, + }, + { + name: "handler not found", + setupMock: func(app *mockApp[transaction.Tx]) { + handlers := map[string]appmodulev2.Handler{} + app.On("QueryHandlers").Return(handlers) + }, + request: createTestRequest(t), + expectError: true, + expectedError: "rpc error: code = NotFound desc = handler not found for /MockRequestMessage", + }, + { + name: "query error", + setupMock: func(app *mockApp[transaction.Tx]) { + reqMsg := &MockRequestMessage{Data: "request"} + respMsg := &MockRequestMessage{Data: "response"} + + handlers := map[string]appmodulev2.Handler{ + "/" + proto.MessageName(&MockRequestMessage{}): { + Func: func(ctx context.Context, msg transaction.Msg) (transaction.Msg, error) { + return respMsg, nil + }, + MakeMsg: func() transaction.Msg { + return reqMsg + }, + MakeMsgResp: func() transaction.Msg { + return respMsg + }, + }, + } + app.On("QueryHandlers").Return(handlers) + app.On("Query", mock.Anything, uint64(0), reqMsg).Return(nil, assert.AnError) + }, + request: createTestRequest(t), + expectError: true, + expectedError: fmt.Sprintf("rpc error: code = Internal desc = query failed: %s", assert.AnError.Error()), + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + mockApp := &mockApp[transaction.Tx]{} + + if tt.setupMock != nil { + tt.setupMock(mockApp) + } + + service := &v2Service{mockApp.QueryHandlers(), mockApp} + resp, err := service.Query(context.Background(), tt.request) + + if tt.expectError { + assert.Error(t, err) + if tt.expectedError != "" { + assert.Equal(t, tt.expectedError, err.Error()) + } + } else { + assert.NoError(t, err) + assert.NotNil(t, resp) + assert.NotNil(t, resp.Response) + } + + mockApp.AssertExpectations(t) + }) + } +} + +func TestV2Service_ListQueryHandlers(t *testing.T) { + tests := []struct { + name string + setupMock func(app *mockApp[transaction.Tx]) + }{ + { + name: "successful list query handlers", + setupMock: func(app *mockApp[transaction.Tx]) { + reqMsg := &MockRequestMessage{Data: "request"} + respMsg := &MockResponseMessage{Data: "response"} + + handlers := map[string]appmodulev2.Handler{ + "/test.Query": { + Func: func(ctx context.Context, msg transaction.Msg) (transaction.Msg, error) { + return respMsg, nil + }, + MakeMsg: func() transaction.Msg { + return reqMsg + }, + MakeMsgResp: func() transaction.Msg { + return respMsg + }, + }, + } + app.On("QueryHandlers").Return(handlers) + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + mockApp := &mockApp[transaction.Tx]{} + + if tt.setupMock != nil { + tt.setupMock(mockApp) + } + + service := &v2Service{mockApp.QueryHandlers(), mockApp} + resp, err := service.ListQueryHandlers(context.Background(), &ListQueryHandlersRequest{}) + + assert.NoError(t, err) + assert.NotNil(t, resp) + assert.Len(t, resp.Handlers, 1) + resp.Handlers[0].RequestName = "/MockRequestMessage" + resp.Handlers[0].ResponseName = "/MockResponseMessage" + + mockApp.AssertExpectations(t) + }) + } +} + +func createTestRequest(t *testing.T) *QueryRequest { + t.Helper() + + reqMsg := &MockRequestMessage{Data: "request"} + reqBytes, err := proto.Marshal(reqMsg) + if err != nil { + t.Fatalf("failed to marshal request: %v", err) + } + + return &QueryRequest{ + Request: &gogoproto.Any{ + TypeUrl: "/" + proto.MessageName(reqMsg), + Value: reqBytes, + }, + } +} diff --git a/server/v2/go.mod b/server/v2/go.mod index 0331cd942b46..0f59d1a71de7 100644 --- a/server/v2/go.mod +++ b/server/v2/go.mod @@ -92,8 +92,10 @@ require ( github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect + github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect + github.com/tendermint/go-amino v0.16.0 // indirect github.com/tidwall/btree v1.7.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.28.0 // indirect diff --git a/server/v2/go.sum b/server/v2/go.sum index 4ea1c4e1b328..0e797e011688 100644 --- a/server/v2/go.sum +++ b/server/v2/go.sum @@ -119,6 +119,7 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= @@ -147,7 +148,10 @@ 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.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= @@ -320,6 +324,8 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= +github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= +github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= @@ -371,6 +377,7 @@ golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -440,6 +447,7 @@ golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNq google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= From ed46a4c93a748ef56d86d405d9836c7699f7bcb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Toledano?= Date: Tue, 5 Nov 2024 16:49:09 +0100 Subject: [PATCH 10/10] refactor(client/v2): offchain uses client/v2/factory (#22344) Co-authored-by: Julien Robert --- client/v2/Makefile | 2 +- client/v2/internal/buf.gen.gogo.yaml | 5 + .../{buf.gen.yaml => buf.gen.pulsar.yaml} | 0 .../offchain/msgSignArbitraryData.proto | 2 + client/v2/internal/testpb/msg.pulsar.go | 28 +- client/v2/internal/testpb/msg_grpc.pb.go | 15 +- client/v2/internal/testpb/query_grpc.pb.go | 10 +- client/v2/offchain/builder.go | 318 ------------- client/v2/offchain/cli.go | 20 +- client/v2/offchain/encode.go | 9 + client/v2/offchain/marshal.go | 43 -- client/v2/offchain/msgSignArbitraryData.pb.go | 432 ++++++++++++++++++ client/v2/offchain/sign.go | 149 +++--- client/v2/offchain/sign_test.go | 61 ++- client/v2/offchain/signature.go | 34 -- client/v2/offchain/verify.go | 53 ++- client/v2/offchain/verify_test.go | 38 +- client/v2/tx/config.go | 24 +- client/v2/tx/config_test.go | 4 +- client/v2/tx/encoder.go | 39 ++ client/v2/tx/factory.go | 48 +- client/v2/tx/factory_test.go | 50 +- client/v2/tx/tx.go | 2 +- client/v2/tx/types.go | 31 +- client/v2/tx/wrapper.go | 11 + 25 files changed, 757 insertions(+), 671 deletions(-) create mode 100644 client/v2/internal/buf.gen.gogo.yaml rename client/v2/internal/{buf.gen.yaml => buf.gen.pulsar.yaml} (100%) delete mode 100644 client/v2/offchain/builder.go delete mode 100644 client/v2/offchain/marshal.go create mode 100644 client/v2/offchain/msgSignArbitraryData.pb.go delete mode 100644 client/v2/offchain/signature.go diff --git a/client/v2/Makefile b/client/v2/Makefile index 1b4bb0cbe7f6..ec0288100be4 100644 --- a/client/v2/Makefile +++ b/client/v2/Makefile @@ -1,2 +1,2 @@ codegen: - @(cd internal; buf generate) \ No newline at end of file + @(cd internal; buf generate --template buf.gen.pulsar.yaml) \ No newline at end of file diff --git a/client/v2/internal/buf.gen.gogo.yaml b/client/v2/internal/buf.gen.gogo.yaml new file mode 100644 index 000000000000..a1df55b815d6 --- /dev/null +++ b/client/v2/internal/buf.gen.gogo.yaml @@ -0,0 +1,5 @@ +version: v1 +plugins: + - name: gocosmos + out: .. + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any diff --git a/client/v2/internal/buf.gen.yaml b/client/v2/internal/buf.gen.pulsar.yaml similarity index 100% rename from client/v2/internal/buf.gen.yaml rename to client/v2/internal/buf.gen.pulsar.yaml diff --git a/client/v2/internal/offchain/msgSignArbitraryData.proto b/client/v2/internal/offchain/msgSignArbitraryData.proto index 0dcce3399ba4..87cff99a5db8 100644 --- a/client/v2/internal/offchain/msgSignArbitraryData.proto +++ b/client/v2/internal/offchain/msgSignArbitraryData.proto @@ -6,6 +6,8 @@ import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; import "amino/amino.proto"; +option go_package = "cosmossdk.io/client/v2/offchain"; + // MsgSignArbitraryData defines an arbitrary, general-purpose, off-chain message message MsgSignArbitraryData { option (amino.name) = "offchain/MsgSignArbitraryData"; diff --git a/client/v2/internal/testpb/msg.pulsar.go b/client/v2/internal/testpb/msg.pulsar.go index 29fd89007a3d..c156d4131627 100644 --- a/client/v2/internal/testpb/msg.pulsar.go +++ b/client/v2/internal/testpb/msg.pulsar.go @@ -4287,27 +4287,27 @@ var file_testpb_msg_proto_rawDesc = []byte{ 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x14, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x15, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xab, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x47, 0x0a, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xac, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x47, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0xca, 0xb4, 0x2d, 0x12, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x20, 0x76, - 0x30, 0x2e, 0x35, 0x30, 0x2e, 0x30, 0x12, 0x5b, 0x0a, 0x08, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, + 0x30, 0x2e, 0x35, 0x30, 0x2e, 0x30, 0x12, 0x5c, 0x0a, 0x08, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x77, 0x62, - 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0xca, 0xb4, 0x2d, - 0x12, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x20, 0x76, 0x30, 0x2e, 0x35, - 0x31, 0x2e, 0x30, 0x42, 0x86, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x42, 0x08, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, - 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, - 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, 0xca, 0xb4, 0x2d, + 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x20, 0x76, 0x30, 0x2e, 0x35, + 0x33, 0x2e, 0x30, 0x20, 0x42, 0x86, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x70, 0x62, 0x42, 0x08, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, + 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, + 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/client/v2/internal/testpb/msg_grpc.pb.go b/client/v2/internal/testpb/msg_grpc.pb.go index ebcfba150bb9..b9ccec990607 100644 --- a/client/v2/internal/testpb/msg_grpc.pb.go +++ b/client/v2/internal/testpb/msg_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) // source: testpb/msg.proto @@ -18,11 +18,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - Msg_Send_FullMethodName = "/testpb.Msg/Send" - Msg_Clawback_FullMethodName = "/testpb.Msg/Clawback" -) - // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -42,7 +37,7 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { func (c *msgClient) Send(ctx context.Context, in *MsgRequest, opts ...grpc.CallOption) (*MsgResponse, error) { out := new(MsgResponse) - err := c.cc.Invoke(ctx, Msg_Send_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/testpb.Msg/Send", in, out, opts...) if err != nil { return nil, err } @@ -51,7 +46,7 @@ func (c *msgClient) Send(ctx context.Context, in *MsgRequest, opts ...grpc.CallO func (c *msgClient) Clawback(ctx context.Context, in *MsgClawbackRequest, opts ...grpc.CallOption) (*MsgClawbackResponse, error) { out := new(MsgClawbackResponse) - err := c.cc.Invoke(ctx, Msg_Clawback_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/testpb.Msg/Clawback", in, out, opts...) if err != nil { return nil, err } @@ -101,7 +96,7 @@ func _Msg_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{ } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Msg_Send_FullMethodName, + FullMethod: "/testpb.Msg/Send", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Send(ctx, req.(*MsgRequest)) @@ -119,7 +114,7 @@ func _Msg_Clawback_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Msg_Clawback_FullMethodName, + FullMethod: "/testpb.Msg/Clawback", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Clawback(ctx, req.(*MsgClawbackRequest)) diff --git a/client/v2/internal/testpb/query_grpc.pb.go b/client/v2/internal/testpb/query_grpc.pb.go index 9f444b76c729..56d177ddc86f 100644 --- a/client/v2/internal/testpb/query_grpc.pb.go +++ b/client/v2/internal/testpb/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) // source: testpb/query.proto @@ -18,10 +18,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - Query_Echo_FullMethodName = "/testpb.Query/Echo" -) - // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -40,7 +36,7 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { func (c *queryClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) { out := new(EchoResponse) - err := c.cc.Invoke(ctx, Query_Echo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/testpb.Query/Echo", in, out, opts...) if err != nil { return nil, err } @@ -86,7 +82,7 @@ func _Query_Echo_Handler(srv interface{}, ctx context.Context, dec func(interfac } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Query_Echo_FullMethodName, + FullMethod: "/testpb.Query/Echo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Echo(ctx, req.(*EchoRequest)) diff --git a/client/v2/offchain/builder.go b/client/v2/offchain/builder.go deleted file mode 100644 index 55c5678cd15c..000000000000 --- a/client/v2/offchain/builder.go +++ /dev/null @@ -1,318 +0,0 @@ -package offchain - -// TODO: remove custom off-chain builder once v2 tx builder is developed. - -import ( - "errors" - "fmt" - - "github.com/cosmos/cosmos-proto/anyutil" - "github.com/cosmos/gogoproto/proto" - protov2 "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/anypb" - - basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - apitx "cosmossdk.io/api/cosmos/tx/v1beta1" - txsigning "cosmossdk.io/x/tx/signing" - - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" -) - -type builder struct { - cdc codec.Codec - tx *apitx.Tx -} - -func newBuilder(cdc codec.Codec) *builder { - return &builder{ - cdc: cdc, - tx: &apitx.Tx{ - Body: &apitx.TxBody{}, - AuthInfo: &apitx.AuthInfo{ - Fee: &apitx.Fee{ - Amount: nil, - GasLimit: 0, - Payer: "", - Granter: "", - }, - }, - Signatures: nil, - }, - } -} - -// GetTx returns the tx. -func (b *builder) GetTx() *apitx.Tx { - return b.tx -} - -// GetSigningTxData returns the necessary data to generate sign bytes. -func (b *builder) GetSigningTxData() (txsigning.TxData, error) { - body := b.tx.Body - authInfo := b.tx.AuthInfo - - msgs := make([]*anypb.Any, len(body.Messages)) - for i, msg := range body.Messages { - msgs[i] = &anypb.Any{ - TypeUrl: msg.TypeUrl, - Value: msg.Value, - } - } - - extOptions := make([]*anypb.Any, len(body.ExtensionOptions)) - for i, extOption := range body.ExtensionOptions { - extOptions[i] = &anypb.Any{ - TypeUrl: extOption.TypeUrl, - Value: extOption.Value, - } - } - - nonCriticalExtOptions := make([]*anypb.Any, len(body.NonCriticalExtensionOptions)) - for i, extOption := range body.NonCriticalExtensionOptions { - nonCriticalExtOptions[i] = &anypb.Any{ - TypeUrl: extOption.TypeUrl, - Value: extOption.Value, - } - } - - feeCoins := authInfo.Fee.Amount - feeAmount := make([]*basev1beta1.Coin, len(feeCoins)) - for i, coin := range feeCoins { - feeAmount[i] = &basev1beta1.Coin{ - Denom: coin.Denom, - Amount: coin.Amount, - } - } - - txSignerInfos := make([]*apitx.SignerInfo, len(authInfo.SignerInfos)) - for i, signerInfo := range authInfo.SignerInfos { - txSignerInfo := &apitx.SignerInfo{ - PublicKey: &anypb.Any{ - TypeUrl: signerInfo.PublicKey.TypeUrl, - Value: signerInfo.PublicKey.Value, - }, - Sequence: signerInfo.Sequence, - ModeInfo: signerInfo.ModeInfo, - } - txSignerInfos[i] = txSignerInfo - } - - txAuthInfo := &apitx.AuthInfo{ - SignerInfos: txSignerInfos, - Fee: &apitx.Fee{ - Amount: feeAmount, - GasLimit: authInfo.Fee.GasLimit, - Payer: authInfo.Fee.Payer, - Granter: authInfo.Fee.Granter, - }, - } - - txBody := &apitx.TxBody{ - Messages: msgs, - Memo: body.Memo, - TimeoutHeight: body.TimeoutHeight, - TimeoutTimestamp: body.TimeoutTimestamp, - ExtensionOptions: extOptions, - NonCriticalExtensionOptions: nonCriticalExtOptions, - } - authInfoBz, err := protov2.Marshal(b.tx.AuthInfo) - if err != nil { - return txsigning.TxData{}, err - } - bodyBz, err := protov2.Marshal(b.tx.Body) - if err != nil { - return txsigning.TxData{}, err - } - txData := txsigning.TxData{ - AuthInfo: txAuthInfo, - AuthInfoBytes: authInfoBz, - Body: txBody, - BodyBytes: bodyBz, - } - return txData, nil -} - -// GetPubKeys returns the pubKeys of the tx. -func (b *builder) GetPubKeys() ([]cryptotypes.PubKey, error) { // If signer already has pubkey in context, this list will have nil in its place - signerInfos := b.tx.AuthInfo.SignerInfos - pks := make([]cryptotypes.PubKey, len(signerInfos)) - - for i, si := range signerInfos { - // NOTE: it is okay to leave this nil if there is no PubKey in the SignerInfo. - // PubKey's can be left unset in SignerInfo. - if si.PublicKey == nil { - continue - } - var pk cryptotypes.PubKey - anyPk := &codectypes.Any{ - TypeUrl: si.PublicKey.TypeUrl, - Value: si.PublicKey.Value, - } - err := b.cdc.UnpackAny(anyPk, &pk) - if err != nil { - return nil, err - } - pks[i] = pk - } - - return pks, nil -} - -// GetSignatures returns the signatures of the tx. -func (b *builder) GetSignatures() ([]OffchainSignature, error) { - signerInfos := b.tx.AuthInfo.SignerInfos - sigs := b.tx.Signatures - pubKeys, err := b.GetPubKeys() - if err != nil { - return nil, err - } - n := len(signerInfos) - res := make([]OffchainSignature, n) - - for i, si := range signerInfos { - // handle nil signatures (in case of simulation) - if si.ModeInfo == nil { - res[i] = OffchainSignature{ - PubKey: pubKeys[i], - } - } else { - var err error - sigData, err := modeInfoAndSigToSignatureData(si.ModeInfo, sigs[i]) - if err != nil { - return nil, err - } - // sequence number is functionally a transaction nonce and referred to as such in the SDK - nonce := si.GetSequence() - res[i] = OffchainSignature{ - PubKey: pubKeys[i], - Data: sigData, - Sequence: nonce, - } - } - } - - return res, nil -} - -// GetSigners returns the signers of the tx. -func (b *builder) GetSigners() ([][]byte, error) { - signers, _, err := b.getSigners() - return signers, err -} - -func (b *builder) getSigners() ([][]byte, []protov2.Message, error) { - var signers [][]byte - seen := map[string]bool{} - - var msgsv2 []protov2.Message - for _, msg := range b.tx.Body.Messages { - msgv2, err := anyutil.Unpack(msg, b.cdc.InterfaceRegistry(), nil) - if err != nil { - return nil, nil, err - } - xs, err := b.cdc.InterfaceRegistry().SigningContext().GetSigners(msgv2) - if err != nil { - return nil, nil, err - } - - msgsv2 = append(msgsv2, msg) - - for _, signer := range xs { - if !seen[string(signer)] { - signers = append(signers, signer) - seen[string(signer)] = true - } - } - } - - return signers, msgsv2, nil -} - -func (b *builder) setMsgs(msgs ...proto.Message) error { - anys := make([]*anypb.Any, len(msgs)) - for i, msg := range msgs { - protoMsg, ok := msg.(protov2.Message) - if !ok { - return errors.New("message is not a proto.Message") - } - protov2MarshalOpts := protov2.MarshalOptions{Deterministic: true} - bz, err := protov2MarshalOpts.Marshal(protoMsg) - if err != nil { - return err - } - anys[i] = &anypb.Any{ - TypeUrl: codectypes.MsgTypeURL(msg), - Value: bz, - } - } - b.tx.Body.Messages = anys - return nil -} - -// SetSignatures set the signatures of the tx. -func (b *builder) SetSignatures(signatures ...OffchainSignature) error { - n := len(signatures) - signerInfos := make([]*apitx.SignerInfo, n) - rawSigs := make([][]byte, n) - var err error - for i, sig := range signatures { - var mi *apitx.ModeInfo - mi, rawSigs[i], err = b.signatureDataToModeInfoAndSig(sig.Data) - if err != nil { - return err - } - - pubKey, err := codectypes.NewAnyWithValue(sig.PubKey) - if err != nil { - return err - } - - signerInfos[i] = &apitx.SignerInfo{ - PublicKey: &anypb.Any{ - TypeUrl: pubKey.TypeUrl, - Value: pubKey.Value, - }, - ModeInfo: mi, - Sequence: sig.Sequence, - } - } - - b.tx.AuthInfo.SignerInfos = signerInfos - b.tx.Signatures = rawSigs - - return nil -} - -// signatureDataToModeInfoAndSig converts a SignatureData to a ModeInfo and raw bytes signature. -func (b *builder) signatureDataToModeInfoAndSig(data SignatureData) (*apitx.ModeInfo, []byte, error) { - if data == nil { - return nil, nil, errors.New("empty SignatureData") - } - - switch data := data.(type) { - case *SingleSignatureData: - return &apitx.ModeInfo{ - Sum: &apitx.ModeInfo_Single_{ - Single: &apitx.ModeInfo_Single{Mode: data.SignMode}, - }, - }, data.Signature, nil - default: - return nil, nil, fmt.Errorf("unexpected signature data type %T", data) - } -} - -// modeInfoAndSigToSignatureData converts a ModeInfo and raw bytes signature to a SignatureData. -func modeInfoAndSigToSignatureData(modeInfo *apitx.ModeInfo, sig []byte) (SignatureData, error) { - switch modeInfoType := modeInfo.Sum.(type) { - case *apitx.ModeInfo_Single_: - return &SingleSignatureData{ - SignMode: modeInfoType.Single.Mode, - Signature: sig, - }, nil - - default: - return nil, fmt.Errorf("unexpected ModeInfo data type %T", modeInfo) - } -} diff --git a/client/v2/offchain/cli.go b/client/v2/offchain/cli.go index fabb3f503beb..7738a6204451 100644 --- a/client/v2/offchain/cli.go +++ b/client/v2/offchain/cli.go @@ -13,10 +13,8 @@ import ( ) const ( - flagNotEmitUnpopulated = "notEmitUnpopulated" - flagIndent = "indent" - flagEncoding = "encoding" - flagFileFormat = "file-format" + flagEncoding = "encoding" + flagFileFormat = "file-format" ) // OffChain off-chain utilities. @@ -51,13 +49,12 @@ func SignFile() *cobra.Command { return err } - notEmitUnpopulated, _ := cmd.Flags().GetBool(flagNotEmitUnpopulated) - indent, _ := cmd.Flags().GetString(flagIndent) encoding, _ := cmd.Flags().GetString(flagEncoding) outputFormat, _ := cmd.Flags().GetString(v2flags.FlagOutput) outputFile, _ := cmd.Flags().GetString(flags.FlagOutputDocument) + signMode, _ := cmd.Flags().GetString(flags.FlagSignMode) - signedTx, err := Sign(clientCtx, bz, args[0], indent, encoding, outputFormat, !notEmitUnpopulated) + signedTx, err := Sign(clientCtx, bz, args[0], encoding, signMode, outputFormat) if err != nil { return err } @@ -75,28 +72,27 @@ func SignFile() *cobra.Command { }, } - cmd.Flags().String(flagIndent, " ", "Choose an indent for the tx") cmd.Flags().String(v2flags.FlagOutput, "json", "Choose an output format for the tx (json|text") - cmd.Flags().Bool(flagNotEmitUnpopulated, false, "Don't show unpopulated fields in the tx") cmd.Flags().String(flagEncoding, "no-encoding", "Choose an encoding method for the file content to be added as msg data (no-encoding|base64|hex)") cmd.Flags().String(flags.FlagOutputDocument, "", "The document will be written to the given file instead of STDOUT") + cmd.PersistentFlags().String(flags.FlagSignMode, "direct", "Choose sign mode (direct|amino-json)") return cmd } // VerifyFile verifies given file with given key. func VerifyFile() *cobra.Command { cmd := &cobra.Command{ - Use: "verify-file ", + Use: "verify-file ", Short: "Verify a file.", Long: "Verify a previously signed file with the given key.", - Args: cobra.ExactArgs(2), + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err } - bz, err := os.ReadFile(args[1]) + bz, err := os.ReadFile(args[0]) if err != nil { return err } diff --git a/client/v2/offchain/encode.go b/client/v2/offchain/encode.go index 6721ffc28cf2..be43316a655f 100644 --- a/client/v2/offchain/encode.go +++ b/client/v2/offchain/encode.go @@ -42,3 +42,12 @@ func getEncoder(encoder string) (encodingFunc, error) { return nil, fmt.Errorf("unknown encoder: %s", encoder) } } + +func encodeDigest(encodingFormat string, digest []byte) (string, error) { + encoder, err := getEncoder(encodingFormat) + if err != nil { + return "", err + } + + return encoder(digest) +} diff --git a/client/v2/offchain/marshal.go b/client/v2/offchain/marshal.go deleted file mode 100644 index 8f90b9830d3f..000000000000 --- a/client/v2/offchain/marshal.go +++ /dev/null @@ -1,43 +0,0 @@ -package offchain - -import ( - "fmt" - - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/encoding/prototext" - "google.golang.org/protobuf/proto" - - apitx "cosmossdk.io/api/cosmos/tx/v1beta1" - v2flags "cosmossdk.io/client/v2/internal/flags" -) - -// marshaller marshals Messages. -type marshaller interface { - Marshal(message proto.Message) ([]byte, error) -} - -// getMarshaller returns the marshaller for the given marshaller id. -func getMarshaller(marshallerId, indent string, emitUnpopulated bool) (marshaller, error) { - switch marshallerId { - case v2flags.OutputFormatJSON: - return protojson.MarshalOptions{ - Indent: indent, - EmitUnpopulated: emitUnpopulated, - }, nil - case v2flags.OutputFormatText: - return prototext.MarshalOptions{ - Indent: indent, - EmitUnknown: emitUnpopulated, - }, nil - } - return nil, fmt.Errorf("marshaller with id '%s' not identified", marshallerId) -} - -// marshalOffChainTx marshals a Tx using given marshaller. -func marshalOffChainTx(tx *apitx.Tx, marshaller marshaller) (string, error) { - bytesTx, err := marshaller.Marshal(tx) - if err != nil { - return "", err - } - return string(bytesTx), nil -} diff --git a/client/v2/offchain/msgSignArbitraryData.pb.go b/client/v2/offchain/msgSignArbitraryData.pb.go new file mode 100644 index 000000000000..2733b9182b95 --- /dev/null +++ b/client/v2/offchain/msgSignArbitraryData.pb.go @@ -0,0 +1,432 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: offchain/msgSignArbitraryData.proto + +package offchain + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + 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 + +// MsgSignArbitraryData defines an arbitrary, general-purpose, off-chain message +type MsgSignArbitraryData struct { + // AppDomain is the application requesting off-chain message signing + AppDomain string `protobuf:"bytes,1,opt,name=app_domain,json=appDomain,proto3" json:"app_domain,omitempty"` + // Signer is the sdk.AccAddress of the message signer + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` + // Data represents the raw bytes of the content that is signed (text, json, etc) + Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *MsgSignArbitraryData) Reset() { *m = MsgSignArbitraryData{} } +func (m *MsgSignArbitraryData) String() string { return proto.CompactTextString(m) } +func (*MsgSignArbitraryData) ProtoMessage() {} +func (*MsgSignArbitraryData) Descriptor() ([]byte, []int) { + return fileDescriptor_f3e1b1b538b29252, []int{0} +} +func (m *MsgSignArbitraryData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSignArbitraryData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSignArbitraryData.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 *MsgSignArbitraryData) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSignArbitraryData.Merge(m, src) +} +func (m *MsgSignArbitraryData) XXX_Size() int { + return m.Size() +} +func (m *MsgSignArbitraryData) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSignArbitraryData.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSignArbitraryData proto.InternalMessageInfo + +func (m *MsgSignArbitraryData) GetAppDomain() string { + if m != nil { + return m.AppDomain + } + return "" +} + +func (m *MsgSignArbitraryData) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *MsgSignArbitraryData) GetData() string { + if m != nil { + return m.Data + } + return "" +} + +func init() { + proto.RegisterType((*MsgSignArbitraryData)(nil), "offchain.MsgSignArbitraryData") +} + +func init() { + proto.RegisterFile("offchain/msgSignArbitraryData.proto", fileDescriptor_f3e1b1b538b29252) +} + +var fileDescriptor_f3e1b1b538b29252 = []byte{ + // 267 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xce, 0x4f, 0x4b, 0x4b, + 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0xcf, 0x2d, 0x4e, 0x0f, 0xce, 0x4c, 0xcf, 0x73, 0x2c, 0x4a, 0xca, + 0x2c, 0x29, 0x4a, 0x2c, 0xaa, 0x74, 0x49, 0x2c, 0x49, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0xe2, 0x80, 0x29, 0x92, 0x92, 0x4c, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0x8e, 0x07, 0x8b, 0xeb, 0x43, + 0x38, 0x10, 0x45, 0x52, 0xe2, 0x10, 0x1e, 0xc8, 0x1c, 0xfd, 0x32, 0x43, 0x10, 0x05, 0x95, 0x10, + 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x21, 0xa5, 0x55, 0x8c, 0x5c, 0x22, 0xbe, + 0x58, 0xec, 0x13, 0x92, 0xe5, 0xe2, 0x4a, 0x2c, 0x28, 0x88, 0x4f, 0xc9, 0xcf, 0x4d, 0xcc, 0xcc, + 0x93, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0xe2, 0x4c, 0x2c, 0x28, 0x70, 0x01, 0x0b, 0x08, 0x19, + 0x70, 0xb1, 0x15, 0x67, 0xa6, 0xe7, 0xa5, 0x16, 0x49, 0x30, 0x81, 0xa4, 0x9c, 0x24, 0x2e, 0x6d, + 0xd1, 0x15, 0x81, 0xba, 0xc2, 0x31, 0x25, 0xa5, 0x28, 0xb5, 0xb8, 0x38, 0xb8, 0xa4, 0x28, 0x33, + 0x2f, 0x3d, 0x08, 0xaa, 0x4e, 0x48, 0x88, 0x8b, 0x25, 0x25, 0xb1, 0x24, 0x51, 0x82, 0x19, 0x6c, + 0x14, 0x98, 0x6d, 0xa5, 0xdb, 0xf4, 0x7c, 0x83, 0x16, 0x54, 0x41, 0xd7, 0xf3, 0x0d, 0x5a, 0xb2, + 0xf0, 0x30, 0xc0, 0xe6, 0x26, 0x27, 0xcb, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, + 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, + 0x88, 0x92, 0x87, 0x58, 0x5d, 0x9c, 0x92, 0xad, 0x97, 0x99, 0xaf, 0x9f, 0x9c, 0x93, 0x99, 0x9a, + 0x57, 0xa2, 0x5f, 0x66, 0xa4, 0x0f, 0x33, 0x2f, 0x89, 0x0d, 0xec, 0x5d, 0x63, 0x40, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x78, 0x04, 0xe8, 0x80, 0x66, 0x01, 0x00, 0x00, +} + +func (m *MsgSignArbitraryData) 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 *MsgSignArbitraryData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSignArbitraryData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintMsgSignArbitraryData(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x1a + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintMsgSignArbitraryData(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x12 + } + if len(m.AppDomain) > 0 { + i -= len(m.AppDomain) + copy(dAtA[i:], m.AppDomain) + i = encodeVarintMsgSignArbitraryData(dAtA, i, uint64(len(m.AppDomain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintMsgSignArbitraryData(dAtA []byte, offset int, v uint64) int { + offset -= sovMsgSignArbitraryData(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgSignArbitraryData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AppDomain) + if l > 0 { + n += 1 + l + sovMsgSignArbitraryData(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovMsgSignArbitraryData(uint64(l)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovMsgSignArbitraryData(uint64(l)) + } + return n +} + +func sovMsgSignArbitraryData(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMsgSignArbitraryData(x uint64) (n int) { + return sovMsgSignArbitraryData(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgSignArbitraryData) 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 ErrIntOverflowMsgSignArbitraryData + } + 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: MsgSignArbitraryData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSignArbitraryData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppDomain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgSignArbitraryData + } + 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 ErrInvalidLengthMsgSignArbitraryData + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgSignArbitraryData + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppDomain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgSignArbitraryData + } + 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 ErrInvalidLengthMsgSignArbitraryData + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgSignArbitraryData + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgSignArbitraryData + } + 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 ErrInvalidLengthMsgSignArbitraryData + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgSignArbitraryData + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgSignArbitraryData(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgSignArbitraryData + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMsgSignArbitraryData(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, ErrIntOverflowMsgSignArbitraryData + } + 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, ErrIntOverflowMsgSignArbitraryData + } + 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, ErrIntOverflowMsgSignArbitraryData + } + 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, ErrInvalidLengthMsgSignArbitraryData + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMsgSignArbitraryData + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMsgSignArbitraryData + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMsgSignArbitraryData = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMsgSignArbitraryData = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMsgSignArbitraryData = fmt.Errorf("proto: unexpected end of group") +) diff --git a/client/v2/offchain/sign.go b/client/v2/offchain/sign.go index b36a50c00ca0..8dfcb907c089 100644 --- a/client/v2/offchain/sign.go +++ b/client/v2/offchain/sign.go @@ -2,18 +2,15 @@ package offchain import ( "context" - - "google.golang.org/protobuf/types/known/anypb" + "fmt" apisigning "cosmossdk.io/api/cosmos/tx/signing/v1beta1" - apitx "cosmossdk.io/api/cosmos/tx/v1beta1" + "cosmossdk.io/client/v2/internal/account" "cosmossdk.io/client/v2/internal/offchain" - txsigning "cosmossdk.io/x/tx/signing" + clitx "cosmossdk.io/client/v2/tx" "github.com/cosmos/cosmos-sdk/client" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keyring" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/version" ) @@ -24,58 +21,64 @@ const ( ExpectedAccountNumber = 0 // ExpectedSequence defines the sequence number an off-chain message must have ExpectedSequence = 0 - - signMode = apisigning.SignMode_SIGN_MODE_TEXTUAL ) -type signerData struct { - Address string - ChainID string - AccountNumber uint64 - Sequence uint64 - PubKey cryptotypes.PubKey +var enabledSignModes = []apisigning.SignMode{ + apisigning.SignMode_SIGN_MODE_DIRECT, + apisigning.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, } // Sign signs given bytes using the specified encoder and SignMode. -func Sign(ctx client.Context, rawBytes []byte, fromName, indent, encoding, output string, emitUnpopulated bool) (string, error) { - encoder, err := getEncoder(encoding) +func Sign(ctx client.Context, rawBytes []byte, fromName, encoding, signMode, output string) (string, error) { + digest, err := encodeDigest(encoding, rawBytes) if err != nil { return "", err } - digest, err := encoder(rawBytes) + keybase, err := keyring.NewAutoCLIKeyring(ctx.Keyring, ctx.AddressCodec) if err != nil { return "", err } - tx, err := sign(ctx, fromName, digest) + txConfig, err := clitx.NewTxConfig(clitx.ConfigOptions{ + AddressCodec: ctx.AddressCodec, + Cdc: ctx.Codec, + ValidatorAddressCodec: ctx.ValidatorAddressCodec, + EnabledSignModes: enabledSignModes, + }) if err != nil { return "", err } - txMarshaller, err := getMarshaller(output, indent, emitUnpopulated) + accRetriever := account.NewAccountRetriever(ctx.AddressCodec, ctx, ctx.InterfaceRegistry) + + sm, err := getSignMode(signMode) if err != nil { return "", err } + params := clitx.TxParameters{ + ChainID: ExpectedChainID, + SignMode: sm, + AccountConfig: clitx.AccountConfig{ + AccountNumber: ExpectedAccountNumber, + Sequence: ExpectedSequence, + FromName: fromName, + }, + } - return marshalOffChainTx(tx, txMarshaller) -} - -// sign signs a digest with provided key and SignMode. -func sign(ctx client.Context, fromName, digest string) (*apitx.Tx, error) { - keybase, err := keyring.NewAutoCLIKeyring(ctx.Keyring, ctx.AddressCodec) + txf, err := clitx.NewFactory(keybase, ctx.Codec, accRetriever, txConfig, ctx.AddressCodec, ctx, params) if err != nil { - return nil, err + return "", err } pubKey, err := keybase.GetPubKey(fromName) if err != nil { - return nil, err + return "", err } addr, err := ctx.AddressCodec.BytesToString(pubKey.Address()) if err != nil { - return nil, err + return "", err } msg := &offchain.MsgSignArbitraryData{ @@ -84,84 +87,38 @@ func sign(ctx client.Context, fromName, digest string) (*apitx.Tx, error) { Data: digest, } - txBuilder := newBuilder(ctx.Codec) - err = txBuilder.setMsgs(msg) - if err != nil { - return nil, err - } - - signerData := signerData{ - Address: addr, - ChainID: ExpectedChainID, - AccountNumber: ExpectedAccountNumber, - Sequence: ExpectedSequence, - PubKey: pubKey, - } - - sigData := &SingleSignatureData{ - SignMode: signMode, - Signature: nil, - } - - sig := OffchainSignature{ - PubKey: pubKey, - Data: sigData, - Sequence: ExpectedSequence, - } - - sigs := []OffchainSignature{sig} - err = txBuilder.SetSignatures(sigs...) - if err != nil { - return nil, err - } - - bytesToSign, err := getSignBytes( - context.Background(), ctx.TxConfig.SignModeHandler(), signerData, txBuilder) - if err != nil { - return nil, err - } - - signedBytes, err := keybase.Sign(fromName, bytesToSign, signMode) + signedTx, err := txf.BuildsSignedTx(context.Background(), msg) if err != nil { - return nil, err + return "", err } - sigData.Signature = signedBytes - - err = txBuilder.SetSignatures(sig) + bz, err := encode(output, signedTx, txConfig) if err != nil { - return nil, err + return "", err } - return txBuilder.GetTx(), nil + return string(bz), nil } -// getSignBytes gets the bytes to be signed for the given Tx and SignMode. -func getSignBytes(ctx context.Context, - handlerMap *txsigning.HandlerMap, - signerData signerData, - tx *builder, -) ([]byte, error) { - txData, err := tx.GetSigningTxData() - if err != nil { - return nil, err - } - - anyPk, err := codectypes.NewAnyWithValue(signerData.PubKey) - if err != nil { - return nil, err +func encode(output string, tx clitx.Tx, config clitx.TxConfig) ([]byte, error) { + switch output { + case "json": + return config.TxJSONEncoder()(tx) + case "text": + return config.TxTextEncoder()(tx) + default: + return nil, fmt.Errorf("unsupported output type: %s", output) } +} - txSignerData := txsigning.SignerData{ - ChainID: signerData.ChainID, - AccountNumber: signerData.AccountNumber, - Sequence: signerData.Sequence, - Address: signerData.Address, - PubKey: &anypb.Any{ - TypeUrl: anyPk.TypeUrl, - Value: anyPk.Value, - }, +// getSignMode returns the corresponding apisigning.SignMode based on the provided mode string. +func getSignMode(mode string) (apisigning.SignMode, error) { + switch mode { + case "direct": + return apisigning.SignMode_SIGN_MODE_DIRECT, nil + case "amino-json": + return apisigning.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, nil } - return handlerMap.GetSignBytes(ctx, signMode, txSignerData, txData) + return apisigning.SignMode_SIGN_MODE_UNSPECIFIED, fmt.Errorf("unsupported sign mode: %s", mode) } diff --git a/client/v2/offchain/sign_test.go b/client/v2/offchain/sign_test.go index b47a84584d36..839872866629 100644 --- a/client/v2/offchain/sign_test.go +++ b/client/v2/offchain/sign_test.go @@ -11,41 +11,54 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" ) -func Test_sign(t *testing.T) { +func TestSign(t *testing.T) { k := keyring.NewInMemory(getCodec()) + _, err := k.NewAccount("signVerify", mnemonic, "", "m/44'/118'/0'/0/0", hd.Secp256k1) + require.NoError(t, err) ctx := client.Context{ - Keyring: k, - TxConfig: newTestConfig(t), - AddressCodec: address.NewBech32Codec("cosmos"), - } - - type args struct { - ctx client.Context - fromName string - digest string + TxConfig: newTestConfig(t), + Codec: getCodec(), + AddressCodec: address.NewBech32Codec("cosmos"), + ValidatorAddressCodec: address.NewBech32Codec("cosmosvaloper"), + Keyring: k, } tests := []struct { - name string - args args + name string + rawBytes []byte + encoding string + signMode string + wantErr bool }{ { - name: "Sign", - args: args{ - ctx: ctx, - fromName: "direct", - digest: "Hello world!", - }, + name: "sign direct", + rawBytes: []byte("hello world"), + encoding: noEncoder, + signMode: "direct", + }, + { + name: "sign amino", + rawBytes: []byte("hello world"), + encoding: noEncoder, + signMode: "amino-json", + }, + { + name: "not supported sign mode", + rawBytes: []byte("hello world"), + encoding: noEncoder, + signMode: "textual", + wantErr: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - _, err := k.NewAccount(tt.args.fromName, mnemonic, tt.name, "m/44'/118'/0'/0/0", hd.Secp256k1) - require.NoError(t, err) - - got, err := sign(tt.args.ctx, tt.args.fromName, tt.args.digest) - require.NoError(t, err) - require.NotNil(t, got) + got, err := Sign(ctx, tt.rawBytes, "signVerify", tt.encoding, tt.signMode, "json") + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + require.NotNil(t, got) + } }) } } diff --git a/client/v2/offchain/signature.go b/client/v2/offchain/signature.go deleted file mode 100644 index d7b9769de983..000000000000 --- a/client/v2/offchain/signature.go +++ /dev/null @@ -1,34 +0,0 @@ -package offchain - -import ( - apitxsigning "cosmossdk.io/api/cosmos/tx/signing/v1beta1" - - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" -) - -type SignatureData interface { - isSignatureData() -} - -func (m *SingleSignatureData) isSignatureData() {} - -type SingleSignatureData struct { - // SignMode represents the SignMode of the signature - SignMode apitxsigning.SignMode - - // Signature is the raw signature. - Signature []byte -} - -type OffchainSignature struct { - // PubKey is the public key to use for verifying the signature - PubKey cryptotypes.PubKey - - // Data is the actual data of the signature which includes SignMode's and - // the signatures themselves for either single or multi-signatures. - Data SignatureData - - // Sequence is the sequence of this account. Only populated in - // SIGN_MODE_DIRECT. - Sequence uint64 -} diff --git a/client/v2/offchain/verify.go b/client/v2/offchain/verify.go index 8b9580d63235..2c064faccc71 100644 --- a/client/v2/offchain/verify.go +++ b/client/v2/offchain/verify.go @@ -6,12 +6,9 @@ import ( "errors" "fmt" - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/encoding/prototext" "google.golang.org/protobuf/types/known/anypb" - apitx "cosmossdk.io/api/cosmos/tx/v1beta1" - v2flags "cosmossdk.io/client/v2/internal/flags" + clitx "cosmossdk.io/client/v2/tx" txsigning "cosmossdk.io/x/tx/signing" "github.com/cosmos/cosmos-sdk/client" @@ -21,29 +18,34 @@ import ( // Verify verifies a digest after unmarshalling it. func Verify(ctx client.Context, digest []byte, fileFormat string) error { - tx, err := unmarshal(digest, fileFormat) + txConfig, err := clitx.NewTxConfig(clitx.ConfigOptions{ + AddressCodec: ctx.AddressCodec, + Cdc: ctx.Codec, + ValidatorAddressCodec: ctx.ValidatorAddressCodec, + EnabledSignModes: enabledSignModes, + }) if err != nil { return err } - return verify(ctx, tx) + dTx, err := unmarshal(fileFormat, digest, txConfig) + if err != nil { + return err + } + + return verify(ctx, dTx) } // verify verifies given Tx. -func verify(ctx client.Context, tx *apitx.Tx) error { - sigTx := builder{ - cdc: ctx.Codec, - tx: tx, - } - +func verify(ctx client.Context, dTx clitx.Tx) error { signModeHandler := ctx.TxConfig.SignModeHandler() - signers, err := sigTx.GetSigners() + signers, err := dTx.GetSigners() if err != nil { return err } - sigs, err := sigTx.GetSignatures() + sigs, err := dTx.GetSignatures() if err != nil { return err } @@ -79,7 +81,7 @@ func verify(ctx client.Context, tx *apitx.Tx) error { }, } - txData, err := sigTx.GetSigningTxData() + txData, err := dTx.GetSigningTxData() if err != nil { return err } @@ -93,18 +95,15 @@ func verify(ctx client.Context, tx *apitx.Tx) error { } // unmarshal unmarshalls a digest to a Tx using protobuf protojson. -func unmarshal(digest []byte, fileFormat string) (*apitx.Tx, error) { - var err error - tx := &apitx.Tx{} - switch fileFormat { - case v2flags.OutputFormatJSON: - err = protojson.Unmarshal(digest, tx) - case v2flags.OutputFormatText: - err = prototext.Unmarshal(digest, tx) +func unmarshal(format string, bz []byte, config clitx.TxConfig) (clitx.Tx, error) { + switch format { + case "json": + return config.TxJSONDecoder()(bz) + case "text": + return config.TxTextDecoder()(bz) default: - return nil, fmt.Errorf("unsupported file format: %s", fileFormat) + return nil, fmt.Errorf("unsupported format: %s", format) } - return tx, err } // verifySignature verifies a transaction signature contained in SignatureData abstracting over different signing modes. @@ -112,12 +111,12 @@ func verifySignature( ctx context.Context, pubKey cryptotypes.PubKey, signerData txsigning.SignerData, - signatureData SignatureData, + signatureData clitx.SignatureData, handler *txsigning.HandlerMap, txData txsigning.TxData, ) error { switch data := signatureData.(type) { - case *SingleSignatureData: + case *clitx.SingleSignatureData: signBytes, err := handler.GetSignBytes(ctx, data.SignMode, signerData, txData) if err != nil { return err diff --git a/client/v2/offchain/verify_test.go b/client/v2/offchain/verify_test.go index ecdd57e75b5b..56345504d80e 100644 --- a/client/v2/offchain/verify_test.go +++ b/client/v2/offchain/verify_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" _ "cosmossdk.io/api/cosmos/crypto/secp256k1" + clitx "cosmossdk.io/client/v2/tx" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec/address" @@ -15,9 +16,10 @@ import ( func Test_Verify(t *testing.T) { ctx := client.Context{ - TxConfig: newTestConfig(t), - Codec: getCodec(), - AddressCodec: address.NewBech32Codec("cosmos"), + TxConfig: newTestConfig(t), + Codec: getCodec(), + AddressCodec: address.NewBech32Codec("cosmos"), + ValidatorAddressCodec: address.NewBech32Codec("cosmosvaloper"), } tests := []struct { @@ -29,26 +31,26 @@ func Test_Verify(t *testing.T) { }{ { name: "verify json", - digest: []byte("{\"body\":{\"messages\":[{\"@type\":\"/offchain.MsgSignArbitraryData\", \"appDomain\":\"simd\", \"signer\":\"cosmos1x33fy6rusfprkntvjsfregss7rvsvyy4lkwrqu\", \"data\":\"{\\n\\t\\\"name\\\": \\\"John\\\",\\n\\t\\\"surname\\\": \\\"Connor\\\",\\n\\t\\\"age\\\": 15\\n}\\n\"}]}, \"authInfo\":{\"signerInfos\":[{\"publicKey\":{\"@type\":\"/cosmos.crypto.secp256k1.PubKey\", \"key\":\"A/Bfsb7grZtysreo48oB1XAXbcgHnEJyhAqzDMgbLlXw\"}, \"modeInfo\":{\"single\":{\"mode\":\"SIGN_MODE_TEXTUAL\"}}}], \"fee\":{}}, \"signatures\":[\"gRufjcmATaJ3hZSiXII3lcsLDJlHM4OhQs3O/QgAK4weQ73kmj30/gw3HwTKxGb4pnVe0iyLXrKRNeSl1O3zSQ==\"]}"), + digest: []byte("{\"body\":{\"messages\":[{\"@type\":\"/offchain.MsgSignArbitraryData\", \"app_domain\":\"\", \"signer\":\"cosmos16877zjk85kwlap3wclpmx34e0xllg2erc7u7m4\", \"data\":\"{\\n\\t\\\"name\\\": \\\"Sarah\\\",\\n\\t\\\"surname\\\": \\\"Connor\\\",\\n\\t\\\"age\\\": 29\\n}\\n\"}], \"timeout_timestamp\":\"0001-01-01T00:00:00Z\"}, \"auth_info\":{\"signer_infos\":[{\"public_key\":{\"@type\":\"/cosmos.crypto.secp256k1.PubKey\", \"key\":\"Ahhu3idSSUAQXtDBvBjUlCPWH3od4rXyWgb7L4scSj4m\"}, \"mode_info\":{\"single\":{\"mode\":\"SIGN_MODE_DIRECT\"}}}], \"fee\":{}}, \"signatures\":[\"tdXsO5uNqIBFSBKEA1e3Wrcb6ejriP9HwlcBTkU7EUJzuezjg6Rvr1a+Kp6umCAN7MWoBHRT2cmqzDfg6RjaYA==\"]}"), fileFormat: "json", ctx: ctx, }, { name: "wrong signer json", - digest: []byte("{\"body\":{\"messages\":[{\"@type\":\"/offchain.MsgSignArbitraryData\", \"appDomain\":\"simd\", \"signer\":\"cosmos1450l4uau674z55c36df0v7904rnvdk9aq8w96j\", \"data\":\"{\\n\\t\\\"name\\\": \\\"John\\\",\\n\\t\\\"surname\\\": \\\"Connor\\\",\\n\\t\\\"age\\\": 15\\n}\\n\"}]}, \"authInfo\":{\"signerInfos\":[{\"publicKey\":{\"@type\":\"/cosmos.crypto.secp256k1.PubKey\", \"key\":\"A/Bfsb7grZtysreo48oB1XAXbcgHnEJyhAqzDMgbLlXw\"}, \"modeInfo\":{\"single\":{\"mode\":\"SIGN_MODE_TEXTUAL\"}}}], \"fee\":{}}, \"signatures\":[\"gRufjcmATaJ3hZSiXII3lcsLDJlHM4OhQs3O/QgAK4weQ73kmj30/gw3HwTKxGb4pnVe0iyLXrKRNeSl1O3zSQ==\"]}"), + digest: []byte("{\"body\":{\"messages\":[{\"@type\":\"/offchain.MsgSignArbitraryData\", \"app_domain\":\"\", \"signer\":\"cosmos1xv9e39mkhhyg5aneu2myj82t7029sv48qu3pgj\", \"data\":\"{\\n\\t\\\"name\\\": \\\"Sarah\\\",\\n\\t\\\"surname\\\": \\\"Connor\\\",\\n\\t\\\"age\\\": 29\\n}\\n\"}], \"timeout_timestamp\":\"0001-01-01T00:00:00Z\"}, \"auth_info\":{\"signer_infos\":[{\"public_key\":{\"@type\":\"/cosmos.crypto.secp256k1.PubKey\", \"key\":\"Ahhu3idSSUAQXtDBvBjUlCPWH3od4rXyWgb7L4scSj4m\"}, \"mode_info\":{\"single\":{\"mode\":\"SIGN_MODE_DIRECT\"}}}], \"fee\":{}}, \"signatures\":[\"tdXsO5uNqIBFSBKEA1e3Wrcb6ejriP9HwlcBTkU7EUJzuezjg6Rvr1a+Kp6umCAN7MWoBHRT2cmqzDfg6RjaYA==\"]}"), fileFormat: "json", ctx: ctx, wantErr: true, }, { name: "verify text", - digest: []byte("body:{messages:{[/offchain.MsgSignArbitraryData]:{app_domain:\"simd\" signer:\"cosmos1x33fy6rusfprkntvjsfregss7rvsvyy4lkwrqu\" data:\"{\\n\\t\\\"name\\\": \\\"John\\\",\\n\\t\\\"surname\\\": \\\"Connor\\\",\\n\\t\\\"age\\\": 15\\n}\\n\"}}} auth_info:{signer_infos:{public_key:{[/cosmos.crypto.secp256k1.PubKey]:{key:\"\\x03\\xf0_\\xb1\\xbe\u0B5Br\\xb2\\xb7\\xa8\\xe3\\xca\\x01\\xd5p\\x17m\\xc8\\x07\\x9cBr\\x84\\n\\xb3\\x0c\\xc8\\x1b.U\\xf0\"}} mode_info:{single:{mode:SIGN_MODE_TEXTUAL}}} fee:{}} signatures:\"\\x81\\x1b\\x9f\\x8dɀM\\xa2w\\x85\\x94\\xa2\\\\\\x827\\x95\\xcb\\x0b\\x0c\\x99G3\\x83\\xa1B\\xcd\\xce\\xfd\\x08\\x00+\\x8c\\x1eC\\xbd\\xe4\\x9a=\\xf4\\xfe\\x0c7\\x1f\\x04\\xca\\xc4f\\xf8\\xa6u^\\xd2,\\x8b^\\xb2\\x915\\xe4\\xa5\\xd4\\xed\\xf3I\"\n"), + digest: []byte("body:{messages:{[/offchain.MsgSignArbitraryData]:{app_domain:\"\" signer:\"cosmos16877zjk85kwlap3wclpmx34e0xllg2erc7u7m4\" data:\"{\\n\\t\\\"name\\\": \\\"Sarah\\\",\\n\\t\\\"surname\\\": \\\"Connor\\\",\\n\\t\\\"age\\\": 29\\n}\\n\"}} timeout_timestamp:{seconds:-62135596800}} auth_info:{signer_infos:{public_key:{[/cosmos.crypto.secp256k1.PubKey]:{key:\"\\x02\\x18n\\xde'RI@\\x10^\\xd0\\xc1\\xbc\\x18Ԕ#\\xd6\\x1fz\\x1d\\xe2\\xb5\\xf2Z\\x06\\xfb/\\x8b\\x1cJ>&\"}} mode_info:{single:{mode:SIGN_MODE_DIRECT}}} fee:{}} signatures:\"\\xb5\\xd5\\xec;\\x9b\\x8d\\xa8\\x80EH\\x12\\x84\\x03W\\xb7Z\\xb7\\x1b\\xe9\\xe8\\xeb\\x88\\xffG\\xc2W\\x01NE;\\x11Bs\\xb9\\xecヤo\\xafV\\xbe*\\x9e\\xae\\x98 \\r\\xecŨ\\x04tS\\xd9ɪ\\xcc7\\xe0\\xe9\\x18\\xda`\"\n"), fileFormat: "text", ctx: ctx, }, { name: "wrong signer text", - digest: []byte("\"body:{messages:{[/offchain.MsgSignArbitraryData]:{app_domain:\\\"simd\\\" signer:\\\"cosmos1450l4uau674z55c36df0v7904rnvdk9aq8w96j\\\" data:\\\"{\\\\n\\\\t\\\\\\\"name\\\\\\\": \\\\\\\"John\\\\\\\",\\\\n\\\\t\\\\\\\"surname\\\\\\\": \\\\\\\"Connor\\\\\\\",\\\\n\\\\t\\\\\\\"age\\\\\\\": 15\\\\n}\\\\n\\\"}}} auth_info:{signer_infos:{public_key:{[/cosmos.crypto.secp256k1.PubKey]:{key:\\\"\\\\x03\\\\xf0_\\\\xb1\\\\xbe\\u0B5Br\\\\xb2\\\\xb7\\\\xa8\\\\xe3\\\\xca\\\\x01\\\\xd5p\\\\x17m\\\\xc8\\\\x07\\\\x9cBr\\\\x84\\\\n\\\\xb3\\\\x0c\\\\xc8\\\\x1b.U\\\\xf0\\\"}} mode_info:{single:{mode:SIGN_MODE_TEXTUAL}}} fee:{}} signatures:\\\"\\\\x81\\\\x1b\\\\x9f\\\\x8dɀM\\\\xa2w\\\\x85\\\\x94\\\\xa2\\\\\\\\\\\\x827\\\\x95\\\\xcb\\\\x0b\\\\x0c\\\\x99G3\\\\x83\\\\xa1B\\\\xcd\\\\xce\\\\xfd\\\\x08\\\\x00+\\\\x8c\\\\x1eC\\\\xbd\\\\xe4\\\\x9a=\\\\xf4\\\\xfe\\\\x0c7\\\\x1f\\\\x04\\\\xca\\\\xc4f\\\\xf8\\\\xa6u^\\\\xd2,\\\\x8b^\\\\xb2\\\\x915\\\\xe4\\\\xa5\\\\xd4\\\\xed\\\\xf3I\\\"\\n"), + digest: []byte("body:{messages:{[/offchain.MsgSignArbitraryData]:{app_domain:\"\" signer:\"cosmos1xv9e39mkhhyg5aneu2myj82t7029sv48qu3pgj\" data:\"{\\n\\t\\\"name\\\": \\\"Sarah\\\",\\n\\t\\\"surname\\\": \\\"Connor\\\",\\n\\t\\\"age\\\": 29\\n}\\n\"}} timeout_timestamp:{seconds:-62135596800}} auth_info:{signer_infos:{public_key:{[/cosmos.crypto.secp256k1.PubKey]:{key:\"\\x02\\x18n\\xde'RI@\\x10^\\xd0\\xc1\\xbc\\x18Ԕ#\\xd6\\x1fz\\x1d\\xe2\\xb5\\xf2Z\\x06\\xfb/\\x8b\\x1cJ>&\"}} mode_info:{single:{mode:SIGN_MODE_DIRECT}}} fee:{}} signatures:\"\\xb5\\xd5\\xec;\\x9b\\x8d\\xa8\\x80EH\\x12\\x84\\x03W\\xb7Z\\xb7\\x1b\\xe9\\xe8\\xeb\\x88\\xffG\\xc2W\\x01NE;\\x11Bs\\xb9\\xecヤo\\xafV\\xbe*\\x9e\\xae\\x98 \\r\\xecŨ\\x04tS\\xd9ɪ\\xcc7\\xe0\\xe9\\x18\\xda`\"\n"), fileFormat: "text", ctx: ctx, wantErr: true, @@ -72,20 +74,28 @@ func Test_SignVerify(t *testing.T) { require.NoError(t, err) ctx := client.Context{ - TxConfig: newTestConfig(t), - Codec: getCodec(), - AddressCodec: address.NewBech32Codec("cosmos"), - Keyring: k, + TxConfig: newTestConfig(t), + Codec: getCodec(), + AddressCodec: address.NewBech32Codec("cosmos"), + ValidatorAddressCodec: address.NewBech32Codec("cosmosvaloper"), + Keyring: k, } - tx, err := sign(ctx, "signVerify", "digest") + tx, err := Sign(ctx, []byte("Hello World!"), "signVerify", "no-encoding", "direct", "json") require.NoError(t, err) - err = verify(ctx, tx) + err = Verify(ctx, []byte(tx), "json") require.NoError(t, err) } func Test_unmarshal(t *testing.T) { + txConfig, err := clitx.NewTxConfig(clitx.ConfigOptions{ + AddressCodec: address.NewBech32Codec("cosmos"), + Cdc: getCodec(), + ValidatorAddressCodec: address.NewBech32Codec("cosmosvaloper"), + EnabledSignModes: enabledSignModes, + }) + require.NoError(t, err) tests := []struct { name string digest []byte @@ -104,7 +114,7 @@ func Test_unmarshal(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := unmarshal(tt.digest, tt.fileFormat) + got, err := unmarshal(tt.fileFormat, tt.digest, txConfig) require.NoError(t, err) require.NotNil(t, got) }) diff --git a/client/v2/tx/config.go b/client/v2/tx/config.go index a500f7c9b009..7c12b3b21ce1 100644 --- a/client/v2/tx/config.go +++ b/client/v2/tx/config.go @@ -51,6 +51,10 @@ type TxEncodingConfig interface { TxJSONEncoder() txEncoder // TxJSONDecoder returns a decoder for JSON transaction decoding. TxJSONDecoder() txDecoder + // TxTextEncoder returns an encoder for text transaction encoding. + TxTextEncoder() txEncoder + // TxTextDecoder returns a decoder for text transaction decoding. + TxTextDecoder() txDecoder // Decoder returns the Decoder interface for decoding transaction bytes into a DecodedTx. Decoder() Decoder } @@ -79,7 +83,7 @@ type ConfigOptions struct { CustomGetSigner map[protoreflect.FullName]signing.GetSignersFunc MaxRecursionDepth int - EnablesSignModes []apitxsigning.SignMode + EnabledSignModes []apitxsigning.SignMode CustomSignModes []signing.SignModeHandler TextualCoinMetadataQueryFn textual.CoinMetadataQueryFn } @@ -98,8 +102,8 @@ func (c *ConfigOptions) validate() error { } // set default signModes if none are provided - if len(c.EnablesSignModes) == 0 { - c.EnablesSignModes = defaultEnabledSignModes + if len(c.EnabledSignModes) == 0 { + c.EnabledSignModes = defaultEnabledSignModes } return nil } @@ -168,6 +172,16 @@ func (t defaultEncodingConfig) TxJSONDecoder() txDecoder { return decodeJsonTx(t.cdc, t.decoder) } +// TxTextEncoder returns the default text transaction encoder. +func (t defaultEncodingConfig) TxTextEncoder() txEncoder { + return encodeTextTx +} + +// TxTextDecoder returns the default text transaction decoder. +func (t defaultEncodingConfig) TxTextDecoder() txDecoder { + return decodeTextTx(t.cdc, t.decoder) +} + // Decoder returns the Decoder instance associated with this encoding configuration. func (t defaultEncodingConfig) Decoder() Decoder { return t.decoder @@ -294,10 +308,10 @@ func newSigningContext(opts ConfigOptions) (*signing.Context, error) { // newHandlerMap constructs a new HandlerMap based on the provided ConfigOptions and signing context. // It initializes handlers for each enabled and custom sign mode specified in the options. func newHandlerMap(opts ConfigOptions, signingCtx *signing.Context) (*signing.HandlerMap, error) { - lenSignModes := len(opts.EnablesSignModes) + lenSignModes := len(opts.EnabledSignModes) handlers := make([]signing.SignModeHandler, lenSignModes+len(opts.CustomSignModes)) - for i, m := range opts.EnablesSignModes { + for i, m := range opts.EnabledSignModes { var err error switch m { case apitxsigning.SignMode_SIGN_MODE_DIRECT: diff --git a/client/v2/tx/config_test.go b/client/v2/tx/config_test.go index 7d1f223d1214..887756f37f6d 100644 --- a/client/v2/tx/config_test.go +++ b/client/v2/tx/config_test.go @@ -111,7 +111,7 @@ func Test_newHandlerMap(t *testing.T) { Decoder: decoder, Cdc: cdc, ValidatorAddressCodec: address.NewBech32Codec("cosmosvaloper"), - EnablesSignModes: []apitxsigning.SignMode{apitxsigning.SignMode_SIGN_MODE_DIRECT}, + EnabledSignModes: []apitxsigning.SignMode{apitxsigning.SignMode_SIGN_MODE_DIRECT}, }, }, { @@ -136,7 +136,7 @@ func Test_newHandlerMap(t *testing.T) { handlerMap, err := newHandlerMap(tt.opts, signingCtx) require.NoError(t, err) require.NotNil(t, handlerMap) - require.Equal(t, len(handlerMap.SupportedModes()), len(tt.opts.EnablesSignModes)+len(tt.opts.CustomSignModes)) + require.Equal(t, len(handlerMap.SupportedModes()), len(tt.opts.EnabledSignModes)+len(tt.opts.CustomSignModes)) }) } } diff --git a/client/v2/tx/encoder.go b/client/v2/tx/encoder.go index 2094efe6d3d5..3e917b34b4c3 100644 --- a/client/v2/tx/encoder.go +++ b/client/v2/tx/encoder.go @@ -4,6 +4,7 @@ import ( "fmt" "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/encoding/prototext" protov2 "google.golang.org/protobuf/proto" txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" @@ -22,6 +23,11 @@ var ( UseProtoNames: true, UseEnumNumbers: false, } + + // textMarshalOptions + textMarshalOptions = prototext.MarshalOptions{ + Indent: "", + } ) // Decoder defines the interface for decoding transaction bytes into a DecodedTx. @@ -100,6 +106,39 @@ func encodeJsonTx(tx Tx) ([]byte, error) { return jsonMarshalOptions.Marshal(wTx.Tx) } +func encodeTextTx(tx Tx) ([]byte, error) { + wTx, ok := tx.(*wrappedTx) + if !ok { + return nil, fmt.Errorf("unexpected tx type: %T", tx) + } + return textMarshalOptions.Marshal(wTx.Tx) +} + +// decodeJsonTx decodes transaction bytes into an apitx.Tx structure using JSON format. +func decodeTextTx(cdc codec.BinaryCodec, decoder Decoder) txDecoder { + return func(txBytes []byte) (Tx, error) { + jsonTx := new(txv1beta1.Tx) + err := prototext.UnmarshalOptions{ + AllowPartial: false, + DiscardUnknown: false, + }.Unmarshal(txBytes, jsonTx) + if err != nil { + return nil, err + } + + pTxBytes, err := protoTxBytes(jsonTx) + if err != nil { + return nil, err + } + + decodedTx, err := decoder.Decode(pTxBytes) + if err != nil { + return nil, err + } + return newWrapperTx(cdc, decodedTx), nil + } +} + func protoTxBytes(tx *txv1beta1.Tx) ([]byte, error) { bodyBytes, err := marshalOption.Marshal(tx.Body) if err != nil { diff --git a/client/v2/tx/factory.go b/client/v2/tx/factory.go index 9dd0eae21a34..8007caaee4f8 100644 --- a/client/v2/tx/factory.go +++ b/client/v2/tx/factory.go @@ -124,22 +124,22 @@ func prepareTxParams(parameters TxParameters, accRetriever account.AccountRetrie return parameters, nil } - if len(parameters.address) == 0 { + if len(parameters.Address) == 0 { return parameters, errors.New("missing 'from address' field") } - if parameters.accountNumber == 0 || parameters.sequence == 0 { - num, seq, err := accRetriever.GetAccountNumberSequence(context.Background(), parameters.address) + if parameters.AccountNumber == 0 || parameters.Sequence == 0 { + num, seq, err := accRetriever.GetAccountNumberSequence(context.Background(), parameters.Address) if err != nil { return parameters, err } - if parameters.accountNumber == 0 { - parameters.accountNumber = num + if parameters.AccountNumber == 0 { + parameters.AccountNumber = num } - if parameters.sequence == 0 { - parameters.sequence = seq + if parameters.Sequence == 0 { + parameters.Sequence = seq } } @@ -328,11 +328,11 @@ func (f *Factory) sign(ctx context.Context, overwriteSig bool) (Tx, error) { } var err error - if f.txParams.signMode == apitxsigning.SignMode_SIGN_MODE_UNSPECIFIED { - f.txParams.signMode = f.txConfig.SignModeHandler().DefaultMode() + if f.txParams.SignMode == apitxsigning.SignMode_SIGN_MODE_UNSPECIFIED { + f.txParams.SignMode = f.txConfig.SignModeHandler().DefaultMode() } - pubKey, err := f.keybase.GetPubKey(f.txParams.fromName) + pubKey, err := f.keybase.GetPubKey(f.txParams.FromName) if err != nil { return nil, err } @@ -343,9 +343,9 @@ func (f *Factory) sign(ctx context.Context, overwriteSig bool) (Tx, error) { } signerData := signing.SignerData{ - ChainID: f.txParams.chainID, - AccountNumber: f.txParams.accountNumber, - Sequence: f.txParams.sequence, + ChainID: f.txParams.ChainID, + AccountNumber: f.txParams.AccountNumber, + Sequence: f.txParams.Sequence, PubKey: &anypb.Any{ TypeUrl: codectypes.MsgTypeURL(pubKey), Value: pubKey.Bytes(), @@ -364,13 +364,13 @@ func (f *Factory) sign(ctx context.Context, overwriteSig bool) (Tx, error) { // By setting the signatures here, we ensure that the correct SignerInfos // are in place for all subsequent operations, regardless of the sign mode. sigData := SingleSignatureData{ - SignMode: f.txParams.signMode, + SignMode: f.txParams.SignMode, Signature: nil, } sig := Signature{ PubKey: pubKey, Data: &sigData, - Sequence: f.txParams.sequence, + Sequence: f.txParams.Sequence, } var prevSignatures []Signature @@ -412,7 +412,7 @@ func (f *Factory) sign(ctx context.Context, overwriteSig bool) (Tx, error) { } // Sign those bytes - sigBytes, err := f.keybase.Sign(f.txParams.fromName, bytesToSign, f.txParams.signMode) + sigBytes, err := f.keybase.Sign(f.txParams.FromName, bytesToSign, f.txParams.SignMode) if err != nil { return nil, err } @@ -425,7 +425,7 @@ func (f *Factory) sign(ctx context.Context, overwriteSig bool) (Tx, error) { sig = Signature{ PubKey: pubKey, Data: &sigData, - Sequence: f.txParams.sequence, + Sequence: f.txParams.Sequence, } if overwriteSig { @@ -460,16 +460,16 @@ func (f *Factory) WithGas(gas uint64) { // WithSequence returns a copy of the Factory with an updated sequence number. func (f *Factory) WithSequence(sequence uint64) { - f.txParams.sequence = sequence + f.txParams.Sequence = sequence } // WithAccountNumber returns a copy of the Factory with an updated account number. func (f *Factory) WithAccountNumber(accnum uint64) { - f.txParams.accountNumber = accnum + f.txParams.AccountNumber = accnum } // sequence returns the sequence number. -func (f *Factory) sequence() uint64 { return f.txParams.sequence } +func (f *Factory) sequence() uint64 { return f.txParams.Sequence } // gasAdjustment returns the gas adjustment value. func (f *Factory) gasAdjustment() float64 { return f.txParams.gasAdjustment } @@ -478,7 +478,7 @@ func (f *Factory) gasAdjustment() float64 { return f.txParams.gasAdjustment } func (f *Factory) simulateAndExecute() bool { return f.txParams.simulateAndExecute } // signMode returns the sign mode. -func (f *Factory) signMode() apitxsigning.SignMode { return f.txParams.signMode } +func (f *Factory) signMode() apitxsigning.SignMode { return f.txParams.SignMode } // getSimPK gets the public key to use for building a simulation tx. // Note, we should only check for keys in the keybase if we are in simulate and execute mode, @@ -492,14 +492,14 @@ func (f *Factory) getSimPK() (cryptotypes.PubKey, error) { ) if f.txParams.simulateAndExecute && f.keybase != nil { - pk, err = f.keybase.GetPubKey(f.txParams.fromName) + pk, err = f.keybase.GetPubKey(f.txParams.FromName) if err != nil { return nil, err } } else { // When in dry-run mode, attempt to retrieve the account using the provided address. // If the account retrieval fails, the default public key is used. - acc, err := f.accountRetriever.GetAccount(context.Background(), f.txParams.address) + acc, err := f.accountRetriever.GetAccount(context.Background(), f.txParams.Address) if err != nil { // If there is an error retrieving the account, return the default public key. return pk, nil @@ -516,7 +516,7 @@ func (f *Factory) getSimPK() (cryptotypes.PubKey, error) { func (f *Factory) getSimSignatureData(pk cryptotypes.PubKey) SignatureData { multisigPubKey, ok := pk.(*multisig.LegacyAminoPubKey) if !ok { - return &SingleSignatureData{SignMode: f.txParams.signMode} + return &SingleSignatureData{SignMode: f.txParams.SignMode} } multiSignatureData := make([]SignatureData, 0, multisigPubKey.Threshold) diff --git a/client/v2/tx/factory_test.go b/client/v2/tx/factory_test.go index 39f21b38d0df..363cf9146bde 100644 --- a/client/v2/tx/factory_test.go +++ b/client/v2/tx/factory_test.go @@ -35,7 +35,7 @@ func TestFactory_prepareTxParams(t *testing.T) { name: "no error", txParams: TxParameters{ AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, }, }, @@ -66,9 +66,9 @@ func TestFactory_BuildUnsignedTx(t *testing.T) { { name: "no error", txParams: TxParameters{ - chainID: "demo", + ChainID: "demo", AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, }, msgs: []transaction.Msg{ @@ -81,9 +81,9 @@ func TestFactory_BuildUnsignedTx(t *testing.T) { { name: "fees and gas price provided", txParams: TxParameters{ - chainID: "demo", + ChainID: "demo", AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, GasConfig: GasConfig{ gasPrices: []*base.DecCoin{ @@ -133,9 +133,9 @@ func TestFactory_calculateGas(t *testing.T) { { name: "no error", txParams: TxParameters{ - chainID: "demo", + ChainID: "demo", AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, GasConfig: GasConfig{ gasAdjustment: 1, @@ -175,9 +175,9 @@ func TestFactory_Simulate(t *testing.T) { { name: "no error", txParams: TxParameters{ - chainID: "demo", + ChainID: "demo", AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, GasConfig: GasConfig{ gasAdjustment: 1, @@ -219,9 +219,9 @@ func TestFactory_BuildSimTx(t *testing.T) { { name: "no error", txParams: TxParameters{ - chainID: "demo", + ChainID: "demo", AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, }, }, @@ -251,10 +251,10 @@ func TestFactory_Sign(t *testing.T) { { name: "no error", txParams: TxParameters{ - chainID: "demo", + ChainID: "demo", AccountConfig: AccountConfig{ - fromName: "alice", - address: addr, + FromName: "alice", + Address: addr, }, }, }, @@ -299,19 +299,19 @@ func TestFactory_getSignBytesAdapter(t *testing.T) { { name: "no error", txParams: TxParameters{ - chainID: "demo", - signMode: apitxsigning.SignMode_SIGN_MODE_DIRECT, + ChainID: "demo", + SignMode: apitxsigning.SignMode_SIGN_MODE_DIRECT, AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, }, }, { name: "signMode not specified", txParams: TxParameters{ - chainID: "demo", + ChainID: "demo", AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, }, error: true, @@ -341,7 +341,7 @@ func TestFactory_getSignBytesAdapter(t *testing.T) { signerData := signing.SignerData{ Address: addr, - ChainID: f.txParams.chainID, + ChainID: f.txParams.ChainID, AccountNumber: 0, Sequence: 0, PubKey: &anypb.Any{ @@ -401,7 +401,7 @@ func TestFactory_WithFunctions(t *testing.T) { name: "with gas", txParams: TxParameters{ AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, }, withFunc: func(f *Factory) { @@ -415,28 +415,28 @@ func TestFactory_WithFunctions(t *testing.T) { name: "with sequence", txParams: TxParameters{ AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, }, withFunc: func(f *Factory) { f.WithSequence(10) }, checkFunc: func(f *Factory) bool { - return f.txParams.AccountConfig.sequence == 10 + return f.txParams.AccountConfig.Sequence == 10 }, }, { name: "with account number", txParams: TxParameters{ AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, }, withFunc: func(f *Factory) { f.WithAccountNumber(123) }, checkFunc: func(f *Factory) bool { - return f.txParams.AccountConfig.accountNumber == 123 + return f.txParams.AccountConfig.AccountNumber == 123 }, }, } diff --git a/client/v2/tx/tx.go b/client/v2/tx/tx.go index ab82c813ac20..c6bb5a548f92 100644 --- a/client/v2/tx/tx.go +++ b/client/v2/tx/tx.go @@ -77,7 +77,7 @@ func newFactory(ctx client.Context, flagSet *pflag.FlagSet) (Factory, error) { AddressCodec: ctx.AddressCodec, Cdc: ctx.Codec, ValidatorAddressCodec: ctx.ValidatorAddressCodec, - EnablesSignModes: ctx.TxConfig.SignModeHandler().SupportedModes(), + EnabledSignModes: ctx.TxConfig.SignModeHandler().SupportedModes(), }) if err != nil { return Factory{}, err diff --git a/client/v2/tx/types.go b/client/v2/tx/types.go index ee60c27065b6..a50b0b996b1d 100644 --- a/client/v2/tx/types.go +++ b/client/v2/tx/types.go @@ -14,6 +14,7 @@ import ( "cosmossdk.io/client/v2/internal/coins" "cosmossdk.io/core/address" "cosmossdk.io/core/transaction" + "cosmossdk.io/x/tx/signing" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) @@ -28,9 +29,9 @@ type HasValidateBasic interface { // TxParameters defines the parameters required for constructing a transaction. type TxParameters struct { timeoutTimestamp time.Time // timeoutTimestamp indicates a timestamp after which the transaction is no longer valid. - chainID string // chainID specifies the unique identifier of the blockchain where the transaction will be processed. + ChainID string // ChainID specifies the unique identifier of the blockchain where the transaction will be processed. memo string // memo contains any arbitrary memo to be attached to the transaction. - signMode apitxsigning.SignMode // signMode determines the signing mode to be used for the transaction. + SignMode apitxsigning.SignMode // signMode determines the signing mode to be used for the transaction. AccountConfig // AccountConfig includes information about the transaction originator's account. GasConfig // GasConfig specifies the gas settings for the transaction. @@ -41,15 +42,15 @@ type TxParameters struct { // AccountConfig defines the 'account' related fields in a transaction. type AccountConfig struct { // accountNumber is the unique identifier for the account. - accountNumber uint64 + AccountNumber uint64 // sequence is the sequence number of the transaction. - sequence uint64 + Sequence uint64 // fromName is the name of the account sending the transaction. - fromName string + FromName string // fromAddress is the address of the account sending the transaction. - fromAddress string + FromAddress string // address is the byte representation of the account address. - address []byte + Address []byte } // GasConfig defines the 'gas' related fields in a transaction. @@ -141,6 +142,8 @@ type Tx interface { GetPubKeys() ([]cryptotypes.PubKey, error) // GetSignatures fetches the signatures attached to the transaction. GetSignatures() ([]Signature, error) + // GetSigningTxData returns the signing.TxData for the transaction. + GetSigningTxData() (signing.TxData, error) } // txParamsFromFlagSet extracts the transaction parameters from the provided FlagSet. @@ -192,15 +195,15 @@ func txParamsFromFlagSet(flags *pflag.FlagSet, keybase keyring2.Keyring, ac addr txParams := TxParameters{ timeoutTimestamp: timeoutTimestamp, - chainID: chainID, + ChainID: chainID, memo: memo, - signMode: getSignMode(signMode), + SignMode: getSignMode(signMode), AccountConfig: AccountConfig{ - accountNumber: accNumber, - sequence: sequence, - fromName: fromName, - fromAddress: fromAddress, - address: addr, + AccountNumber: accNumber, + Sequence: sequence, + FromName: fromName, + FromAddress: fromAddress, + Address: addr, }, GasConfig: gasConfig, FeeConfig: feeConfig, diff --git a/client/v2/tx/wrapper.go b/client/v2/tx/wrapper.go index fbcf62126bfc..5fc1ef528861 100644 --- a/client/v2/tx/wrapper.go +++ b/client/v2/tx/wrapper.go @@ -10,6 +10,7 @@ import ( "cosmossdk.io/core/transaction" "cosmossdk.io/x/tx/decode" + "cosmossdk.io/x/tx/signing" "github.com/cosmos/cosmos-sdk/codec" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -96,6 +97,16 @@ func (w wrappedTx) GetSignatures() ([]Signature, error) { return signatures, nil } +func (w wrappedTx) GetSigningTxData() (signing.TxData, error) { + return signing.TxData{ + Body: w.Tx.Body, + AuthInfo: w.Tx.AuthInfo, + BodyBytes: w.TxRaw.BodyBytes, + AuthInfoBytes: w.TxRaw.AuthInfoBytes, + BodyHasUnknownNonCriticals: w.TxBodyHasUnknownNonCriticals, + }, nil +} + // decodeAny decodes a protobuf Any message into a concrete proto.Message. func (w wrappedTx) decodeAny(anyPb *anypb.Any) (proto.Message, error) { name := anyPb.GetTypeUrl()